function H_Att_Relative = calcH_Att_Relative(param,states_old,states_new)

% x(k)
q0_wi_old = states_old(1);
q1_wi_old = states_old(2);
q2_wi_old = states_old(3);
q3_wi_old = states_old(4);

q0_ic_old = states_old(29);
q1_ic_old = states_old(30);
q2_ic_old = states_old(31);
q3_ic_old = states_old(32);

q0_vw_old = states_old(36);
q1_vw_old = states_old(37);
q2_vw_old = states_old(38);
q3_vw_old = states_old(39);

% x(k+m)
q0_wi_new = states_new(1);
q1_wi_new = states_new(2);
q2_wi_new = states_new(3);
q3_wi_new = states_new(4);

q0_ic_new = states_new(29);
q1_ic_new = states_new(30);
q2_ic_new = states_new(31);
q3_ic_new = states_new(32);

q0_vw_new = states_new(36);
q1_vw_new = states_new(37);
q2_vw_new = states_new(38);
q3_vw_new = states_new(39);


%% Construct attitude H matrix in relative measurement

%% qH(k)

% qHk(q_wi) = delta(z_q_relative) / delta(q_wi_k)
H_z_q_relative_qwi_old = [[ (q0_ic_new*(q1_wi_new*q1_vw_new - q0_wi_new*q0_vw_new + q2_wi_new*q2_vw_new + q3_wi_new*q3_vw_new) + q1_ic_new*(q0_wi_new*q1_vw_new + q1_wi_new*q0_vw_new - q2_wi_new*q3_vw_new + q3_wi_new*q2_vw_new) + q2_ic_new*(q0_wi_new*q2_vw_new + q2_wi_new*q0_vw_new + q1_wi_new*q3_vw_new - q3_wi_new*q1_vw_new) + q3_ic_new*(q0_wi_new*q3_vw_new - q1_wi_new*q2_vw_new + q2_wi_new*q1_vw_new + q3_wi_new*q0_vw_new))*(q1_ic_old*q1_vw_old - q0_ic_old*q0_vw_old + q2_ic_old*q2_vw_old + q3_ic_old*q3_vw_old) + (q0_ic_new*(q0_wi_new*q1_vw_new + q1_wi_new*q0_vw_new - q2_wi_new*q3_vw_new + q3_wi_new*q2_vw_new) - q1_ic_new*(q1_wi_new*q1_vw_new - q0_wi_new*q0_vw_new + q2_wi_new*q2_vw_new + q3_wi_new*q3_vw_new) - q2_ic_new*(q0_wi_new*q3_vw_new - q1_wi_new*q2_vw_new + q2_wi_new*q1_vw_new + q3_wi_new*q0_vw_new) + q3_ic_new*(q0_wi_new*q2_vw_new + q2_wi_new*q0_vw_new + q1_wi_new*q3_vw_new - q3_wi_new*q1_vw_new))*(q0_ic_old*q1_vw_old + q1_ic_old*q0_vw_old - q2_ic_old*q3_vw_old + q3_ic_old*q2_vw_old) + (q0_ic_new*(q0_wi_new*q2_vw_new + q2_wi_new*q0_vw_new + q1_wi_new*q3_vw_new - q3_wi_new*q1_vw_new) + q1_ic_new*(q0_wi_new*q3_vw_new - q1_wi_new*q2_vw_new + q2_wi_new*q1_vw_new + q3_wi_new*q0_vw_new) - q2_ic_new*(q1_wi_new*q1_vw_new - q0_wi_new*q0_vw_new + q2_wi_new*q2_vw_new + q3_wi_new*q3_vw_new) - q3_ic_new*(q0_wi_new*q1_vw_new + q1_wi_new*q0_vw_new - q2_wi_new*q3_vw_new + q3_wi_new*q2_vw_new))*(q0_ic_old*q2_vw_old + q2_ic_old*q0_vw_old + q1_ic_old*q3_vw_old - q3_ic_old*q1_vw_old) + (q0_ic_new*(q0_wi_new*q3_vw_new - q1_wi_new*q2_vw_new + q2_wi_new*q1_vw_new + q3_wi_new*q0_vw_new) - q1_ic_new*(q0_wi_new*q2_vw_new + q2_wi_new*q0_vw_new + q1_wi_new*q3_vw_new - q3_wi_new*q1_vw_new) + q2_ic_new*(q0_wi_new*q1_vw_new + q1_wi_new*q0_vw_new - q2_wi_new*q3_vw_new + q3_wi_new*q2_vw_new) - q3_ic_new*(q1_wi_new*q1_vw_new - q0_wi_new*q0_vw_new + q2_wi_new*q2_vw_new + q3_wi_new*q3_vw_new))*(q0_ic_old*q3_vw_old - q1_ic_old*q2_vw_old + q2_ic_old*q1_vw_old + q3_ic_old*q0_vw_old), (q0_ic_new*(q1_wi_new*q1_vw_new - q0_wi_new*q0_vw_new + q2_wi_new*q2_vw_new + q3_wi_new*q3_vw_new) + q1_ic_new*(q0_wi_new*q1_vw_new + q1_wi_new*q0_vw_new - q2_wi_new*q3_vw_new + q3_wi_new*q2_vw_new) + q2_ic_new*(q0_wi_new*q2_vw_new + q2_wi_new*q0_vw_new + q1_wi_new*q3_vw_new - q3_wi_new*q1_vw_new) + q3_ic_new*(q0_wi_new*q3_vw_new - q1_wi_new*q2_vw_new + q2_wi_new*q1_vw_new + q3_wi_new*q0_vw_new))*(q0_ic_old*q1_vw_old + q1_ic_old*q0_vw_old + q2_ic_old*q3_vw_old - q3_ic_old*q2_vw_old) + (q0_ic_new*(q0_wi_new*q1_vw_new + q1_wi_new*q0_vw_new - q2_wi_new*q3_vw_new + q3_wi_new*q2_vw_new) - q1_ic_new*(q1_wi_new*q1_vw_new - q0_wi_new*q0_vw_new + q2_wi_new*q2_vw_new + q3_wi_new*q3_vw_new) - q2_ic_new*(q0_wi_new*q3_vw_new - q1_wi_new*q2_vw_new + q2_wi_new*q1_vw_new + q3_wi_new*q0_vw_new) + q3_ic_new*(q0_wi_new*q2_vw_new + q2_wi_new*q0_vw_new + q1_wi_new*q3_vw_new - q3_wi_new*q1_vw_new))*(q0_ic_old*q0_vw_old - q1_ic_old*q1_vw_old + q2_ic_old*q2_vw_old + q3_ic_old*q3_vw_old) - (q0_ic_new*(q0_wi_new*q2_vw_new + q2_wi_new*q0_vw_new + q1_wi_new*q3_vw_new - q3_wi_new*q1_vw_new) + q1_ic_new*(q0_wi_new*q3_vw_new - q1_wi_new*q2_vw_new + q2_wi_new*q1_vw_new + q3_wi_new*q0_vw_new) - q2_ic_new*(q1_wi_new*q1_vw_new - q0_wi_new*q0_vw_new + q2_wi_new*q2_vw_new + q3_wi_new*q3_vw_new) - q3_ic_new*(q0_wi_new*q1_vw_new + q1_wi_new*q0_vw_new - q2_wi_new*q3_vw_new + q3_wi_new*q2_vw_new))*(q1_ic_old*q2_vw_old - q0_ic_old*q3_vw_old + q2_ic_old*q1_vw_old + q3_ic_old*q0_vw_old) - (q0_ic_new*(q0_wi_new*q3_vw_new - q1_wi_new*q2_vw_new + q2_wi_new*q1_vw_new + q3_wi_new*q0_vw_new) - q1_ic_new*(q0_wi_new*q2_vw_new + q2_wi_new*q0_vw_new + q1_wi_new*q3_vw_new - q3_wi_new*q1_vw_new) + q2_ic_new*(q0_wi_new*q1_vw_new + q1_wi_new*q0_vw_new - q2_wi_new*q3_vw_new + q3_wi_new*q2_vw_new) - q3_ic_new*(q1_wi_new*q1_vw_new - q0_wi_new*q0_vw_new + q2_wi_new*q2_vw_new + q3_wi_new*q3_vw_new))*(q0_ic_old*q2_vw_old - q2_ic_old*q0_vw_old + q1_ic_old*q3_vw_old + q3_ic_old*q1_vw_old), (q0_ic_new*(q1_wi_new*q1_vw_new - q0_wi_new*q0_vw_new + q2_wi_new*q2_vw_new + q3_wi_new*q3_vw_new) + q1_ic_new*(q0_wi_new*q1_vw_new + q1_wi_new*q0_vw_new - q2_wi_new*q3_vw_new + q3_wi_new*q2_vw_new) + q2_ic_new*(q0_wi_new*q2_vw_new + q2_wi_new*q0_vw_new + q1_wi_new*q3_vw_new - q3_wi_new*q1_vw_new) + q3_ic_new*(q0_wi_new*q3_vw_new - q1_wi_new*q2_vw_new + q2_wi_new*q1_vw_new + q3_wi_new*q0_vw_new))*(q0_ic_old*q2_vw_old + q2_ic_old*q0_vw_old - q1_ic_old*q3_vw_old + q3_ic_old*q1_vw_old) - (q0_ic_new*(q0_wi_new*q1_vw_new + q1_wi_new*q0_vw_new - q2_wi_new*q3_vw_new + q3_wi_new*q2_vw_new) - q1_ic_new*(q1_wi_new*q1_vw_new - q0_wi_new*q0_vw_new + q2_wi_new*q2_vw_new + q3_wi_new*q3_vw_new) - q2_ic_new*(q0_wi_new*q3_vw_new - q1_wi_new*q2_vw_new + q2_wi_new*q1_vw_new + q3_wi_new*q0_vw_new) + q3_ic_new*(q0_wi_new*q2_vw_new + q2_wi_new*q0_vw_new + q1_wi_new*q3_vw_new - q3_wi_new*q1_vw_new))*(q0_ic_old*q3_vw_old + q1_ic_old*q2_vw_old + q2_ic_old*q1_vw_old - q3_ic_old*q0_vw_old) + (q0_ic_new*(q0_wi_new*q2_vw_new + q2_wi_new*q0_vw_new + q1_wi_new*q3_vw_new - q3_wi_new*q1_vw_new) + q1_ic_new*(q0_wi_new*q3_vw_new - q1_wi_new*q2_vw_new + q2_wi_new*q1_vw_new + q3_wi_new*q0_vw_new) - q2_ic_new*(q1_wi_new*q1_vw_new - q0_wi_new*q0_vw_new + q2_wi_new*q2_vw_new + q3_wi_new*q3_vw_new) - q3_ic_new*(q0_wi_new*q1_vw_new + q1_wi_new*q0_vw_new - q2_wi_new*q3_vw_new + q3_wi_new*q2_vw_new))*(q0_ic_old*q0_vw_old + q1_ic_old*q1_vw_old - q2_ic_old*q2_vw_old + q3_ic_old*q3_vw_old) - (q0_ic_new*(q0_wi_new*q3_vw_new - q1_wi_new*q2_vw_new + q2_wi_new*q1_vw_new + q3_wi_new*q0_vw_new) - q1_ic_new*(q0_wi_new*q2_vw_new + q2_wi_new*q0_vw_new + q1_wi_new*q3_vw_new - q3_wi_new*q1_vw_new) + q2_ic_new*(q0_wi_new*q1_vw_new + q1_wi_new*q0_vw_new - q2_wi_new*q3_vw_new + q3_wi_new*q2_vw_new) - q3_ic_new*(q1_wi_new*q1_vw_new - q0_wi_new*q0_vw_new + q2_wi_new*q2_vw_new + q3_wi_new*q3_vw_new))*(q1_ic_old*q0_vw_old - q0_ic_old*q1_vw_old + q2_ic_old*q3_vw_old + q3_ic_old*q2_vw_old), (q0_ic_new*(q1_wi_new*q1_vw_new - q0_wi_new*q0_vw_new + q2_wi_new*q2_vw_new + q3_wi_new*q3_vw_new) + q1_ic_new*(q0_wi_new*q1_vw_new + q1_wi_new*q0_vw_new - q2_wi_new*q3_vw_new + q3_wi_new*q2_vw_new) + q2_ic_new*(q0_wi_new*q2_vw_new + q2_wi_new*q0_vw_new + q1_wi_new*q3_vw_new - q3_wi_new*q1_vw_new) + q3_ic_new*(q0_wi_new*q3_vw_new - q1_wi_new*q2_vw_new + q2_wi_new*q1_vw_new + q3_wi_new*q0_vw_new))*(q0_ic_old*q3_vw_old + q1_ic_old*q2_vw_old - q2_ic_old*q1_vw_old + q3_ic_old*q0_vw_old) - (q0_ic_new*(q0_wi_new*q1_vw_new + q1_wi_new*q0_vw_new - q2_wi_new*q3_vw_new + q3_wi_new*q2_vw_new) - q1_ic_new*(q1_wi_new*q1_vw_new - q0_wi_new*q0_vw_new + q2_wi_new*q2_vw_new + q3_wi_new*q3_vw_new) - q2_ic_new*(q0_wi_new*q3_vw_new - q1_wi_new*q2_vw_new + q2_wi_new*q1_vw_new + q3_wi_new*q0_vw_new) + q3_ic_new*(q0_wi_new*q2_vw_new + q2_wi_new*q0_vw_new + q1_wi_new*q3_vw_new - q3_wi_new*q1_vw_new))*(q2_ic_old*q0_vw_old - q0_ic_old*q2_vw_old + q1_ic_old*q3_vw_old + q3_ic_old*q1_vw_old) - (q0_ic_new*(q0_wi_new*q2_vw_new + q2_wi_new*q0_vw_new + q1_wi_new*q3_vw_new - q3_wi_new*q1_vw_new) + q1_ic_new*(q0_wi_new*q3_vw_new - q1_wi_new*q2_vw_new + q2_wi_new*q1_vw_new + q3_wi_new*q0_vw_new) - q2_ic_new*(q1_wi_new*q1_vw_new - q0_wi_new*q0_vw_new + q2_wi_new*q2_vw_new + q3_wi_new*q3_vw_new) - q3_ic_new*(q0_wi_new*q1_vw_new + q1_wi_new*q0_vw_new - q2_wi_new*q3_vw_new + q3_wi_new*q2_vw_new))*(q0_ic_old*q1_vw_old - q1_ic_old*q0_vw_old + q2_ic_old*q3_vw_old + q3_ic_old*q2_vw_old) + (q0_ic_new*(q0_wi_new*q3_vw_new - q1_wi_new*q2_vw_new + q2_wi_new*q1_vw_new + q3_wi_new*q0_vw_new) - q1_ic_new*(q0_wi_new*q2_vw_new + q2_wi_new*q0_vw_new + q1_wi_new*q3_vw_new - q3_wi_new*q1_vw_new) + q2_ic_new*(q0_wi_new*q1_vw_new + q1_wi_new*q0_vw_new - q2_wi_new*q3_vw_new + q3_wi_new*q2_vw_new) - q3_ic_new*(q1_wi_new*q1_vw_new - q0_wi_new*q0_vw_new + q2_wi_new*q2_vw_new + q3_wi_new*q3_vw_new))*(q0_ic_old*q0_vw_old + q1_ic_old*q1_vw_old + q2_ic_old*q2_vw_old - q3_ic_old*q3_vw_old)]
                          [ (q0_ic_new*(q0_wi_new*q1_vw_new + q1_wi_new*q0_vw_new - q2_wi_new*q3_vw_new + q3_wi_new*q2_vw_new) - q1_ic_new*(q1_wi_new*q1_vw_new - q0_wi_new*q0_vw_new + q2_wi_new*q2_vw_new + q3_wi_new*q3_vw_new) - q2_ic_new*(q0_wi_new*q3_vw_new - q1_wi_new*q2_vw_new + q2_wi_new*q1_vw_new + q3_wi_new*q0_vw_new) + q3_ic_new*(q0_wi_new*q2_vw_new + q2_wi_new*q0_vw_new + q1_wi_new*q3_vw_new - q3_wi_new*q1_vw_new))*(q1_ic_old*q1_vw_old - q0_ic_old*q0_vw_old + q2_ic_old*q2_vw_old + q3_ic_old*q3_vw_old) - (q0_ic_new*(q1_wi_new*q1_vw_new - q0_wi_new*q0_vw_new + q2_wi_new*q2_vw_new + q3_wi_new*q3_vw_new) + q1_ic_new*(q0_wi_new*q1_vw_new + q1_wi_new*q0_vw_new - q2_wi_new*q3_vw_new + q3_wi_new*q2_vw_new) + q2_ic_new*(q0_wi_new*q2_vw_new + q2_wi_new*q0_vw_new + q1_wi_new*q3_vw_new - q3_wi_new*q1_vw_new) + q3_ic_new*(q0_wi_new*q3_vw_new - q1_wi_new*q2_vw_new + q2_wi_new*q1_vw_new + q3_wi_new*q0_vw_new))*(q0_ic_old*q1_vw_old + q1_ic_old*q0_vw_old - q2_ic_old*q3_vw_old + q3_ic_old*q2_vw_old) - (q0_ic_new*(q0_wi_new*q2_vw_new + q2_wi_new*q0_vw_new + q1_wi_new*q3_vw_new - q3_wi_new*q1_vw_new) + q1_ic_new*(q0_wi_new*q3_vw_new - q1_wi_new*q2_vw_new + q2_wi_new*q1_vw_new + q3_wi_new*q0_vw_new) - q2_ic_new*(q1_wi_new*q1_vw_new - q0_wi_new*q0_vw_new + q2_wi_new*q2_vw_new + q3_wi_new*q3_vw_new) - q3_ic_new*(q0_wi_new*q1_vw_new + q1_wi_new*q0_vw_new - q2_wi_new*q3_vw_new + q3_wi_new*q2_vw_new))*(q0_ic_old*q3_vw_old - q1_ic_old*q2_vw_old + q2_ic_old*q1_vw_old + q3_ic_old*q0_vw_old) + (q0_ic_new*(q0_wi_new*q3_vw_new - q1_wi_new*q2_vw_new + q2_wi_new*q1_vw_new + q3_wi_new*q0_vw_new) - q1_ic_new*(q0_wi_new*q2_vw_new + q2_wi_new*q0_vw_new + q1_wi_new*q3_vw_new - q3_wi_new*q1_vw_new) + q2_ic_new*(q0_wi_new*q1_vw_new + q1_wi_new*q0_vw_new - q2_wi_new*q3_vw_new + q3_wi_new*q2_vw_new) - q3_ic_new*(q1_wi_new*q1_vw_new - q0_wi_new*q0_vw_new + q2_wi_new*q2_vw_new + q3_wi_new*q3_vw_new))*(q0_ic_old*q2_vw_old + q2_ic_old*q0_vw_old + q1_ic_old*q3_vw_old - q3_ic_old*q1_vw_old), (q0_ic_new*(q0_wi_new*q1_vw_new + q1_wi_new*q0_vw_new - q2_wi_new*q3_vw_new + q3_wi_new*q2_vw_new) - q1_ic_new*(q1_wi_new*q1_vw_new - q0_wi_new*q0_vw_new + q2_wi_new*q2_vw_new + q3_wi_new*q3_vw_new) - q2_ic_new*(q0_wi_new*q3_vw_new - q1_wi_new*q2_vw_new + q2_wi_new*q1_vw_new + q3_wi_new*q0_vw_new) + q3_ic_new*(q0_wi_new*q2_vw_new + q2_wi_new*q0_vw_new + q1_wi_new*q3_vw_new - q3_wi_new*q1_vw_new))*(q0_ic_old*q1_vw_old + q1_ic_old*q0_vw_old + q2_ic_old*q3_vw_old - q3_ic_old*q2_vw_old) - (q0_ic_new*(q1_wi_new*q1_vw_new - q0_wi_new*q0_vw_new + q2_wi_new*q2_vw_new + q3_wi_new*q3_vw_new) + q1_ic_new*(q0_wi_new*q1_vw_new + q1_wi_new*q0_vw_new - q2_wi_new*q3_vw_new + q3_wi_new*q2_vw_new) + q2_ic_new*(q0_wi_new*q2_vw_new + q2_wi_new*q0_vw_new + q1_wi_new*q3_vw_new - q3_wi_new*q1_vw_new) + q3_ic_new*(q0_wi_new*q3_vw_new - q1_wi_new*q2_vw_new + q2_wi_new*q1_vw_new + q3_wi_new*q0_vw_new))*(q0_ic_old*q0_vw_old - q1_ic_old*q1_vw_old + q2_ic_old*q2_vw_old + q3_ic_old*q3_vw_old) + (q0_ic_new*(q0_wi_new*q2_vw_new + q2_wi_new*q0_vw_new + q1_wi_new*q3_vw_new - q3_wi_new*q1_vw_new) + q1_ic_new*(q0_wi_new*q3_vw_new - q1_wi_new*q2_vw_new + q2_wi_new*q1_vw_new + q3_wi_new*q0_vw_new) - q2_ic_new*(q1_wi_new*q1_vw_new - q0_wi_new*q0_vw_new + q2_wi_new*q2_vw_new + q3_wi_new*q3_vw_new) - q3_ic_new*(q0_wi_new*q1_vw_new + q1_wi_new*q0_vw_new - q2_wi_new*q3_vw_new + q3_wi_new*q2_vw_new))*(q0_ic_old*q2_vw_old - q2_ic_old*q0_vw_old + q1_ic_old*q3_vw_old + q3_ic_old*q1_vw_old) - (q0_ic_new*(q0_wi_new*q3_vw_new - q1_wi_new*q2_vw_new + q2_wi_new*q1_vw_new + q3_wi_new*q0_vw_new) - q1_ic_new*(q0_wi_new*q2_vw_new + q2_wi_new*q0_vw_new + q1_wi_new*q3_vw_new - q3_wi_new*q1_vw_new) + q2_ic_new*(q0_wi_new*q1_vw_new + q1_wi_new*q0_vw_new - q2_wi_new*q3_vw_new + q3_wi_new*q2_vw_new) - q3_ic_new*(q1_wi_new*q1_vw_new - q0_wi_new*q0_vw_new + q2_wi_new*q2_vw_new + q3_wi_new*q3_vw_new))*(q1_ic_old*q2_vw_old - q0_ic_old*q3_vw_old + q2_ic_old*q1_vw_old + q3_ic_old*q0_vw_old), (q0_ic_new*(q1_wi_new*q1_vw_new - q0_wi_new*q0_vw_new + q2_wi_new*q2_vw_new + q3_wi_new*q3_vw_new) + q1_ic_new*(q0_wi_new*q1_vw_new + q1_wi_new*q0_vw_new - q2_wi_new*q3_vw_new + q3_wi_new*q2_vw_new) + q2_ic_new*(q0_wi_new*q2_vw_new + q2_wi_new*q0_vw_new + q1_wi_new*q3_vw_new - q3_wi_new*q1_vw_new) + q3_ic_new*(q0_wi_new*q3_vw_new - q1_wi_new*q2_vw_new + q2_wi_new*q1_vw_new + q3_wi_new*q0_vw_new))*(q0_ic_old*q3_vw_old + q1_ic_old*q2_vw_old + q2_ic_old*q1_vw_old - q3_ic_old*q0_vw_old) + (q0_ic_new*(q0_wi_new*q1_vw_new + q1_wi_new*q0_vw_new - q2_wi_new*q3_vw_new + q3_wi_new*q2_vw_new) - q1_ic_new*(q1_wi_new*q1_vw_new - q0_wi_new*q0_vw_new + q2_wi_new*q2_vw_new + q3_wi_new*q3_vw_new) - q2_ic_new*(q0_wi_new*q3_vw_new - q1_wi_new*q2_vw_new + q2_wi_new*q1_vw_new + q3_wi_new*q0_vw_new) + q3_ic_new*(q0_wi_new*q2_vw_new + q2_wi_new*q0_vw_new + q1_wi_new*q3_vw_new - q3_wi_new*q1_vw_new))*(q0_ic_old*q2_vw_old + q2_ic_old*q0_vw_old - q1_ic_old*q3_vw_old + q3_ic_old*q1_vw_old) + (q0_ic_new*(q0_wi_new*q2_vw_new + q2_wi_new*q0_vw_new + q1_wi_new*q3_vw_new - q3_wi_new*q1_vw_new) + q1_ic_new*(q0_wi_new*q3_vw_new - q1_wi_new*q2_vw_new + q2_wi_new*q1_vw_new + q3_wi_new*q0_vw_new) - q2_ic_new*(q1_wi_new*q1_vw_new - q0_wi_new*q0_vw_new + q2_wi_new*q2_vw_new + q3_wi_new*q3_vw_new) - q3_ic_new*(q0_wi_new*q1_vw_new + q1_wi_new*q0_vw_new - q2_wi_new*q3_vw_new + q3_wi_new*q2_vw_new))*(q1_ic_old*q0_vw_old - q0_ic_old*q1_vw_old + q2_ic_old*q3_vw_old + q3_ic_old*q2_vw_old) + (q0_ic_new*(q0_wi_new*q3_vw_new - q1_wi_new*q2_vw_new + q2_wi_new*q1_vw_new + q3_wi_new*q0_vw_new) - q1_ic_new*(q0_wi_new*q2_vw_new + q2_wi_new*q0_vw_new + q1_wi_new*q3_vw_new - q3_wi_new*q1_vw_new) + q2_ic_new*(q0_wi_new*q1_vw_new + q1_wi_new*q0_vw_new - q2_wi_new*q3_vw_new + q3_wi_new*q2_vw_new) - q3_ic_new*(q1_wi_new*q1_vw_new - q0_wi_new*q0_vw_new + q2_wi_new*q2_vw_new + q3_wi_new*q3_vw_new))*(q0_ic_old*q0_vw_old + q1_ic_old*q1_vw_old - q2_ic_old*q2_vw_old + q3_ic_old*q3_vw_old), (q0_ic_new*(q1_wi_new*q1_vw_new - q0_wi_new*q0_vw_new + q2_wi_new*q2_vw_new + q3_wi_new*q3_vw_new) + q1_ic_new*(q0_wi_new*q1_vw_new + q1_wi_new*q0_vw_new - q2_wi_new*q3_vw_new + q3_wi_new*q2_vw_new) + q2_ic_new*(q0_wi_new*q2_vw_new + q2_wi_new*q0_vw_new + q1_wi_new*q3_vw_new - q3_wi_new*q1_vw_new) + q3_ic_new*(q0_wi_new*q3_vw_new - q1_wi_new*q2_vw_new + q2_wi_new*q1_vw_new + q3_wi_new*q0_vw_new))*(q2_ic_old*q0_vw_old - q0_ic_old*q2_vw_old + q1_ic_old*q3_vw_old + q3_ic_old*q1_vw_old) + (q0_ic_new*(q0_wi_new*q1_vw_new + q1_wi_new*q0_vw_new - q2_wi_new*q3_vw_new + q3_wi_new*q2_vw_new) - q1_ic_new*(q1_wi_new*q1_vw_new - q0_wi_new*q0_vw_new + q2_wi_new*q2_vw_new + q3_wi_new*q3_vw_new) - q2_ic_new*(q0_wi_new*q3_vw_new - q1_wi_new*q2_vw_new + q2_wi_new*q1_vw_new + q3_wi_new*q0_vw_new) + q3_ic_new*(q0_wi_new*q2_vw_new + q2_wi_new*q0_vw_new + q1_wi_new*q3_vw_new - q3_wi_new*q1_vw_new))*(q0_ic_old*q3_vw_old + q1_ic_old*q2_vw_old - q2_ic_old*q1_vw_old + q3_ic_old*q0_vw_old) - (q0_ic_new*(q0_wi_new*q2_vw_new + q2_wi_new*q0_vw_new + q1_wi_new*q3_vw_new - q3_wi_new*q1_vw_new) + q1_ic_new*(q0_wi_new*q3_vw_new - q1_wi_new*q2_vw_new + q2_wi_new*q1_vw_new + q3_wi_new*q0_vw_new) - q2_ic_new*(q1_wi_new*q1_vw_new - q0_wi_new*q0_vw_new + q2_wi_new*q2_vw_new + q3_wi_new*q3_vw_new) - q3_ic_new*(q0_wi_new*q1_vw_new + q1_wi_new*q0_vw_new - q2_wi_new*q3_vw_new + q3_wi_new*q2_vw_new))*(q0_ic_old*q0_vw_old + q1_ic_old*q1_vw_old + q2_ic_old*q2_vw_old - q3_ic_old*q3_vw_old) - (q0_ic_new*(q0_wi_new*q3_vw_new - q1_wi_new*q2_vw_new + q2_wi_new*q1_vw_new + q3_wi_new*q0_vw_new) - q1_ic_new*(q0_wi_new*q2_vw_new + q2_wi_new*q0_vw_new + q1_wi_new*q3_vw_new - q3_wi_new*q1_vw_new) + q2_ic_new*(q0_wi_new*q1_vw_new + q1_wi_new*q0_vw_new - q2_wi_new*q3_vw_new + q3_wi_new*q2_vw_new) - q3_ic_new*(q1_wi_new*q1_vw_new - q0_wi_new*q0_vw_new + q2_wi_new*q2_vw_new + q3_wi_new*q3_vw_new))*(q0_ic_old*q1_vw_old - q1_ic_old*q0_vw_old + q2_ic_old*q3_vw_old + q3_ic_old*q2_vw_old)]
                          [ (q0_ic_new*(q0_wi_new*q1_vw_new + q1_wi_new*q0_vw_new - q2_wi_new*q3_vw_new + q3_wi_new*q2_vw_new) - q1_ic_new*(q1_wi_new*q1_vw_new - q0_wi_new*q0_vw_new + q2_wi_new*q2_vw_new + q3_wi_new*q3_vw_new) - q2_ic_new*(q0_wi_new*q3_vw_new - q1_wi_new*q2_vw_new + q2_wi_new*q1_vw_new + q3_wi_new*q0_vw_new) + q3_ic_new*(q0_wi_new*q2_vw_new + q2_wi_new*q0_vw_new + q1_wi_new*q3_vw_new - q3_wi_new*q1_vw_new))*(q0_ic_old*q3_vw_old - q1_ic_old*q2_vw_old + q2_ic_old*q1_vw_old + q3_ic_old*q0_vw_old) - (q0_ic_new*(q1_wi_new*q1_vw_new - q0_wi_new*q0_vw_new + q2_wi_new*q2_vw_new + q3_wi_new*q3_vw_new) + q1_ic_new*(q0_wi_new*q1_vw_new + q1_wi_new*q0_vw_new - q2_wi_new*q3_vw_new + q3_wi_new*q2_vw_new) + q2_ic_new*(q0_wi_new*q2_vw_new + q2_wi_new*q0_vw_new + q1_wi_new*q3_vw_new - q3_wi_new*q1_vw_new) + q3_ic_new*(q0_wi_new*q3_vw_new - q1_wi_new*q2_vw_new + q2_wi_new*q1_vw_new + q3_wi_new*q0_vw_new))*(q0_ic_old*q2_vw_old + q2_ic_old*q0_vw_old + q1_ic_old*q3_vw_old - q3_ic_old*q1_vw_old) + (q0_ic_new*(q0_wi_new*q2_vw_new + q2_wi_new*q0_vw_new + q1_wi_new*q3_vw_new - q3_wi_new*q1_vw_new) + q1_ic_new*(q0_wi_new*q3_vw_new - q1_wi_new*q2_vw_new + q2_wi_new*q1_vw_new + q3_wi_new*q0_vw_new) - q2_ic_new*(q1_wi_new*q1_vw_new - q0_wi_new*q0_vw_new + q2_wi_new*q2_vw_new + q3_wi_new*q3_vw_new) - q3_ic_new*(q0_wi_new*q1_vw_new + q1_wi_new*q0_vw_new - q2_wi_new*q3_vw_new + q3_wi_new*q2_vw_new))*(q1_ic_old*q1_vw_old - q0_ic_old*q0_vw_old + q2_ic_old*q2_vw_old + q3_ic_old*q3_vw_old) - (q0_ic_new*(q0_wi_new*q3_vw_new - q1_wi_new*q2_vw_new + q2_wi_new*q1_vw_new + q3_wi_new*q0_vw_new) - q1_ic_new*(q0_wi_new*q2_vw_new + q2_wi_new*q0_vw_new + q1_wi_new*q3_vw_new - q3_wi_new*q1_vw_new) + q2_ic_new*(q0_wi_new*q1_vw_new + q1_wi_new*q0_vw_new - q2_wi_new*q3_vw_new + q3_wi_new*q2_vw_new) - q3_ic_new*(q1_wi_new*q1_vw_new - q0_wi_new*q0_vw_new + q2_wi_new*q2_vw_new + q3_wi_new*q3_vw_new))*(q0_ic_old*q1_vw_old + q1_ic_old*q0_vw_old - q2_ic_old*q3_vw_old + q3_ic_old*q2_vw_old), (q0_ic_new*(q1_wi_new*q1_vw_new - q0_wi_new*q0_vw_new + q2_wi_new*q2_vw_new + q3_wi_new*q3_vw_new) + q1_ic_new*(q0_wi_new*q1_vw_new + q1_wi_new*q0_vw_new - q2_wi_new*q3_vw_new + q3_wi_new*q2_vw_new) + q2_ic_new*(q0_wi_new*q2_vw_new + q2_wi_new*q0_vw_new + q1_wi_new*q3_vw_new - q3_wi_new*q1_vw_new) + q3_ic_new*(q0_wi_new*q3_vw_new - q1_wi_new*q2_vw_new + q2_wi_new*q1_vw_new + q3_wi_new*q0_vw_new))*(q1_ic_old*q2_vw_old - q0_ic_old*q3_vw_old + q2_ic_old*q1_vw_old + q3_ic_old*q0_vw_old) - (q0_ic_new*(q0_wi_new*q1_vw_new + q1_wi_new*q0_vw_new - q2_wi_new*q3_vw_new + q3_wi_new*q2_vw_new) - q1_ic_new*(q1_wi_new*q1_vw_new - q0_wi_new*q0_vw_new + q2_wi_new*q2_vw_new + q3_wi_new*q3_vw_new) - q2_ic_new*(q0_wi_new*q3_vw_new - q1_wi_new*q2_vw_new + q2_wi_new*q1_vw_new + q3_wi_new*q0_vw_new) + q3_ic_new*(q0_wi_new*q2_vw_new + q2_wi_new*q0_vw_new + q1_wi_new*q3_vw_new - q3_wi_new*q1_vw_new))*(q0_ic_old*q2_vw_old - q2_ic_old*q0_vw_old + q1_ic_old*q3_vw_old + q3_ic_old*q1_vw_old) + (q0_ic_new*(q0_wi_new*q2_vw_new + q2_wi_new*q0_vw_new + q1_wi_new*q3_vw_new - q3_wi_new*q1_vw_new) + q1_ic_new*(q0_wi_new*q3_vw_new - q1_wi_new*q2_vw_new + q2_wi_new*q1_vw_new + q3_wi_new*q0_vw_new) - q2_ic_new*(q1_wi_new*q1_vw_new - q0_wi_new*q0_vw_new + q2_wi_new*q2_vw_new + q3_wi_new*q3_vw_new) - q3_ic_new*(q0_wi_new*q1_vw_new + q1_wi_new*q0_vw_new - q2_wi_new*q3_vw_new + q3_wi_new*q2_vw_new))*(q0_ic_old*q1_vw_old + q1_ic_old*q0_vw_old + q2_ic_old*q3_vw_old - q3_ic_old*q2_vw_old) - (q0_ic_new*(q0_wi_new*q3_vw_new - q1_wi_new*q2_vw_new + q2_wi_new*q1_vw_new + q3_wi_new*q0_vw_new) - q1_ic_new*(q0_wi_new*q2_vw_new + q2_wi_new*q0_vw_new + q1_wi_new*q3_vw_new - q3_wi_new*q1_vw_new) + q2_ic_new*(q0_wi_new*q1_vw_new + q1_wi_new*q0_vw_new - q2_wi_new*q3_vw_new + q3_wi_new*q2_vw_new) - q3_ic_new*(q1_wi_new*q1_vw_new - q0_wi_new*q0_vw_new + q2_wi_new*q2_vw_new + q3_wi_new*q3_vw_new))*(q0_ic_old*q0_vw_old - q1_ic_old*q1_vw_old + q2_ic_old*q2_vw_old + q3_ic_old*q3_vw_old), (q0_ic_new*(q0_wi_new*q2_vw_new + q2_wi_new*q0_vw_new + q1_wi_new*q3_vw_new - q3_wi_new*q1_vw_new) + q1_ic_new*(q0_wi_new*q3_vw_new - q1_wi_new*q2_vw_new + q2_wi_new*q1_vw_new + q3_wi_new*q0_vw_new) - q2_ic_new*(q1_wi_new*q1_vw_new - q0_wi_new*q0_vw_new + q2_wi_new*q2_vw_new + q3_wi_new*q3_vw_new) - q3_ic_new*(q0_wi_new*q1_vw_new + q1_wi_new*q0_vw_new - q2_wi_new*q3_vw_new + q3_wi_new*q2_vw_new))*(q0_ic_old*q2_vw_old + q2_ic_old*q0_vw_old - q1_ic_old*q3_vw_old + q3_ic_old*q1_vw_old) - (q0_ic_new*(q0_wi_new*q1_vw_new + q1_wi_new*q0_vw_new - q2_wi_new*q3_vw_new + q3_wi_new*q2_vw_new) - q1_ic_new*(q1_wi_new*q1_vw_new - q0_wi_new*q0_vw_new + q2_wi_new*q2_vw_new + q3_wi_new*q3_vw_new) - q2_ic_new*(q0_wi_new*q3_vw_new - q1_wi_new*q2_vw_new + q2_wi_new*q1_vw_new + q3_wi_new*q0_vw_new) + q3_ic_new*(q0_wi_new*q2_vw_new + q2_wi_new*q0_vw_new + q1_wi_new*q3_vw_new - q3_wi_new*q1_vw_new))*(q1_ic_old*q0_vw_old - q0_ic_old*q1_vw_old + q2_ic_old*q3_vw_old + q3_ic_old*q2_vw_old) - (q0_ic_new*(q1_wi_new*q1_vw_new - q0_wi_new*q0_vw_new + q2_wi_new*q2_vw_new + q3_wi_new*q3_vw_new) + q1_ic_new*(q0_wi_new*q1_vw_new + q1_wi_new*q0_vw_new - q2_wi_new*q3_vw_new + q3_wi_new*q2_vw_new) + q2_ic_new*(q0_wi_new*q2_vw_new + q2_wi_new*q0_vw_new + q1_wi_new*q3_vw_new - q3_wi_new*q1_vw_new) + q3_ic_new*(q0_wi_new*q3_vw_new - q1_wi_new*q2_vw_new + q2_wi_new*q1_vw_new + q3_wi_new*q0_vw_new))*(q0_ic_old*q0_vw_old + q1_ic_old*q1_vw_old - q2_ic_old*q2_vw_old + q3_ic_old*q3_vw_old) + (q0_ic_new*(q0_wi_new*q3_vw_new - q1_wi_new*q2_vw_new + q2_wi_new*q1_vw_new + q3_wi_new*q0_vw_new) - q1_ic_new*(q0_wi_new*q2_vw_new + q2_wi_new*q0_vw_new + q1_wi_new*q3_vw_new - q3_wi_new*q1_vw_new) + q2_ic_new*(q0_wi_new*q1_vw_new + q1_wi_new*q0_vw_new - q2_wi_new*q3_vw_new + q3_wi_new*q2_vw_new) - q3_ic_new*(q1_wi_new*q1_vw_new - q0_wi_new*q0_vw_new + q2_wi_new*q2_vw_new + q3_wi_new*q3_vw_new))*(q0_ic_old*q3_vw_old + q1_ic_old*q2_vw_old + q2_ic_old*q1_vw_old - q3_ic_old*q0_vw_old), (q0_ic_new*(q1_wi_new*q1_vw_new - q0_wi_new*q0_vw_new + q2_wi_new*q2_vw_new + q3_wi_new*q3_vw_new) + q1_ic_new*(q0_wi_new*q1_vw_new + q1_wi_new*q0_vw_new - q2_wi_new*q3_vw_new + q3_wi_new*q2_vw_new) + q2_ic_new*(q0_wi_new*q2_vw_new + q2_wi_new*q0_vw_new + q1_wi_new*q3_vw_new - q3_wi_new*q1_vw_new) + q3_ic_new*(q0_wi_new*q3_vw_new - q1_wi_new*q2_vw_new + q2_wi_new*q1_vw_new + q3_wi_new*q0_vw_new))*(q0_ic_old*q1_vw_old - q1_ic_old*q0_vw_old + q2_ic_old*q3_vw_old + q3_ic_old*q2_vw_old) + (q0_ic_new*(q0_wi_new*q1_vw_new + q1_wi_new*q0_vw_new - q2_wi_new*q3_vw_new + q3_wi_new*q2_vw_new) - q1_ic_new*(q1_wi_new*q1_vw_new - q0_wi_new*q0_vw_new + q2_wi_new*q2_vw_new + q3_wi_new*q3_vw_new) - q2_ic_new*(q0_wi_new*q3_vw_new - q1_wi_new*q2_vw_new + q2_wi_new*q1_vw_new + q3_wi_new*q0_vw_new) + q3_ic_new*(q0_wi_new*q2_vw_new + q2_wi_new*q0_vw_new + q1_wi_new*q3_vw_new - q3_wi_new*q1_vw_new))*(q0_ic_old*q0_vw_old + q1_ic_old*q1_vw_old + q2_ic_old*q2_vw_old - q3_ic_old*q3_vw_old) + (q0_ic_new*(q0_wi_new*q2_vw_new + q2_wi_new*q0_vw_new + q1_wi_new*q3_vw_new - q3_wi_new*q1_vw_new) + q1_ic_new*(q0_wi_new*q3_vw_new - q1_wi_new*q2_vw_new + q2_wi_new*q1_vw_new + q3_wi_new*q0_vw_new) - q2_ic_new*(q1_wi_new*q1_vw_new - q0_wi_new*q0_vw_new + q2_wi_new*q2_vw_new + q3_wi_new*q3_vw_new) - q3_ic_new*(q0_wi_new*q1_vw_new + q1_wi_new*q0_vw_new - q2_wi_new*q3_vw_new + q3_wi_new*q2_vw_new))*(q0_ic_old*q3_vw_old + q1_ic_old*q2_vw_old - q2_ic_old*q1_vw_old + q3_ic_old*q0_vw_old) + (q0_ic_new*(q0_wi_new*q3_vw_new - q1_wi_new*q2_vw_new + q2_wi_new*q1_vw_new + q3_wi_new*q0_vw_new) - q1_ic_new*(q0_wi_new*q2_vw_new + q2_wi_new*q0_vw_new + q1_wi_new*q3_vw_new - q3_wi_new*q1_vw_new) + q2_ic_new*(q0_wi_new*q1_vw_new + q1_wi_new*q0_vw_new - q2_wi_new*q3_vw_new + q3_wi_new*q2_vw_new) - q3_ic_new*(q1_wi_new*q1_vw_new - q0_wi_new*q0_vw_new + q2_wi_new*q2_vw_new + q3_wi_new*q3_vw_new))*(q2_ic_old*q0_vw_old - q0_ic_old*q2_vw_old + q1_ic_old*q3_vw_old + q3_ic_old*q1_vw_old)]
                          [ (q0_ic_new*(q0_wi_new*q2_vw_new + q2_wi_new*q0_vw_new + q1_wi_new*q3_vw_new - q3_wi_new*q1_vw_new) + q1_ic_new*(q0_wi_new*q3_vw_new - q1_wi_new*q2_vw_new + q2_wi_new*q1_vw_new + q3_wi_new*q0_vw_new) - q2_ic_new*(q1_wi_new*q1_vw_new - q0_wi_new*q0_vw_new + q2_wi_new*q2_vw_new + q3_wi_new*q3_vw_new) - q3_ic_new*(q0_wi_new*q1_vw_new + q1_wi_new*q0_vw_new - q2_wi_new*q3_vw_new + q3_wi_new*q2_vw_new))*(q0_ic_old*q1_vw_old + q1_ic_old*q0_vw_old - q2_ic_old*q3_vw_old + q3_ic_old*q2_vw_old) - (q0_ic_new*(q0_wi_new*q1_vw_new + q1_wi_new*q0_vw_new - q2_wi_new*q3_vw_new + q3_wi_new*q2_vw_new) - q1_ic_new*(q1_wi_new*q1_vw_new - q0_wi_new*q0_vw_new + q2_wi_new*q2_vw_new + q3_wi_new*q3_vw_new) - q2_ic_new*(q0_wi_new*q3_vw_new - q1_wi_new*q2_vw_new + q2_wi_new*q1_vw_new + q3_wi_new*q0_vw_new) + q3_ic_new*(q0_wi_new*q2_vw_new + q2_wi_new*q0_vw_new + q1_wi_new*q3_vw_new - q3_wi_new*q1_vw_new))*(q0_ic_old*q2_vw_old + q2_ic_old*q0_vw_old + q1_ic_old*q3_vw_old - q3_ic_old*q1_vw_old) - (q0_ic_new*(q1_wi_new*q1_vw_new - q0_wi_new*q0_vw_new + q2_wi_new*q2_vw_new + q3_wi_new*q3_vw_new) + q1_ic_new*(q0_wi_new*q1_vw_new + q1_wi_new*q0_vw_new - q2_wi_new*q3_vw_new + q3_wi_new*q2_vw_new) + q2_ic_new*(q0_wi_new*q2_vw_new + q2_wi_new*q0_vw_new + q1_wi_new*q3_vw_new - q3_wi_new*q1_vw_new) + q3_ic_new*(q0_wi_new*q3_vw_new - q1_wi_new*q2_vw_new + q2_wi_new*q1_vw_new + q3_wi_new*q0_vw_new))*(q0_ic_old*q3_vw_old - q1_ic_old*q2_vw_old + q2_ic_old*q1_vw_old + q3_ic_old*q0_vw_old) + (q0_ic_new*(q0_wi_new*q3_vw_new - q1_wi_new*q2_vw_new + q2_wi_new*q1_vw_new + q3_wi_new*q0_vw_new) - q1_ic_new*(q0_wi_new*q2_vw_new + q2_wi_new*q0_vw_new + q1_wi_new*q3_vw_new - q3_wi_new*q1_vw_new) + q2_ic_new*(q0_wi_new*q1_vw_new + q1_wi_new*q0_vw_new - q2_wi_new*q3_vw_new + q3_wi_new*q2_vw_new) - q3_ic_new*(q1_wi_new*q1_vw_new - q0_wi_new*q0_vw_new + q2_wi_new*q2_vw_new + q3_wi_new*q3_vw_new))*(q1_ic_old*q1_vw_old - q0_ic_old*q0_vw_old + q2_ic_old*q2_vw_old + q3_ic_old*q3_vw_old), (q0_ic_new*(q1_wi_new*q1_vw_new - q0_wi_new*q0_vw_new + q2_wi_new*q2_vw_new + q3_wi_new*q3_vw_new) + q1_ic_new*(q0_wi_new*q1_vw_new + q1_wi_new*q0_vw_new - q2_wi_new*q3_vw_new + q3_wi_new*q2_vw_new) + q2_ic_new*(q0_wi_new*q2_vw_new + q2_wi_new*q0_vw_new + q1_wi_new*q3_vw_new - q3_wi_new*q1_vw_new) + q3_ic_new*(q0_wi_new*q3_vw_new - q1_wi_new*q2_vw_new + q2_wi_new*q1_vw_new + q3_wi_new*q0_vw_new))*(q0_ic_old*q2_vw_old - q2_ic_old*q0_vw_old + q1_ic_old*q3_vw_old + q3_ic_old*q1_vw_old) + (q0_ic_new*(q0_wi_new*q1_vw_new + q1_wi_new*q0_vw_new - q2_wi_new*q3_vw_new + q3_wi_new*q2_vw_new) - q1_ic_new*(q1_wi_new*q1_vw_new - q0_wi_new*q0_vw_new + q2_wi_new*q2_vw_new + q3_wi_new*q3_vw_new) - q2_ic_new*(q0_wi_new*q3_vw_new - q1_wi_new*q2_vw_new + q2_wi_new*q1_vw_new + q3_wi_new*q0_vw_new) + q3_ic_new*(q0_wi_new*q2_vw_new + q2_wi_new*q0_vw_new + q1_wi_new*q3_vw_new - q3_wi_new*q1_vw_new))*(q1_ic_old*q2_vw_old - q0_ic_old*q3_vw_old + q2_ic_old*q1_vw_old + q3_ic_old*q0_vw_old) + (q0_ic_new*(q0_wi_new*q2_vw_new + q2_wi_new*q0_vw_new + q1_wi_new*q3_vw_new - q3_wi_new*q1_vw_new) + q1_ic_new*(q0_wi_new*q3_vw_new - q1_wi_new*q2_vw_new + q2_wi_new*q1_vw_new + q3_wi_new*q0_vw_new) - q2_ic_new*(q1_wi_new*q1_vw_new - q0_wi_new*q0_vw_new + q2_wi_new*q2_vw_new + q3_wi_new*q3_vw_new) - q3_ic_new*(q0_wi_new*q1_vw_new + q1_wi_new*q0_vw_new - q2_wi_new*q3_vw_new + q3_wi_new*q2_vw_new))*(q0_ic_old*q0_vw_old - q1_ic_old*q1_vw_old + q2_ic_old*q2_vw_old + q3_ic_old*q3_vw_old) + (q0_ic_new*(q0_wi_new*q3_vw_new - q1_wi_new*q2_vw_new + q2_wi_new*q1_vw_new + q3_wi_new*q0_vw_new) - q1_ic_new*(q0_wi_new*q2_vw_new + q2_wi_new*q0_vw_new + q1_wi_new*q3_vw_new - q3_wi_new*q1_vw_new) + q2_ic_new*(q0_wi_new*q1_vw_new + q1_wi_new*q0_vw_new - q2_wi_new*q3_vw_new + q3_wi_new*q2_vw_new) - q3_ic_new*(q1_wi_new*q1_vw_new - q0_wi_new*q0_vw_new + q2_wi_new*q2_vw_new + q3_wi_new*q3_vw_new))*(q0_ic_old*q1_vw_old + q1_ic_old*q0_vw_old + q2_ic_old*q3_vw_old - q3_ic_old*q2_vw_old), (q0_ic_new*(q1_wi_new*q1_vw_new - q0_wi_new*q0_vw_new + q2_wi_new*q2_vw_new + q3_wi_new*q3_vw_new) + q1_ic_new*(q0_wi_new*q1_vw_new + q1_wi_new*q0_vw_new - q2_wi_new*q3_vw_new + q3_wi_new*q2_vw_new) + q2_ic_new*(q0_wi_new*q2_vw_new + q2_wi_new*q0_vw_new + q1_wi_new*q3_vw_new - q3_wi_new*q1_vw_new) + q3_ic_new*(q0_wi_new*q3_vw_new - q1_wi_new*q2_vw_new + q2_wi_new*q1_vw_new + q3_wi_new*q0_vw_new))*(q1_ic_old*q0_vw_old - q0_ic_old*q1_vw_old + q2_ic_old*q3_vw_old + q3_ic_old*q2_vw_old) - (q0_ic_new*(q0_wi_new*q1_vw_new + q1_wi_new*q0_vw_new - q2_wi_new*q3_vw_new + q3_wi_new*q2_vw_new) - q1_ic_new*(q1_wi_new*q1_vw_new - q0_wi_new*q0_vw_new + q2_wi_new*q2_vw_new + q3_wi_new*q3_vw_new) - q2_ic_new*(q0_wi_new*q3_vw_new - q1_wi_new*q2_vw_new + q2_wi_new*q1_vw_new + q3_wi_new*q0_vw_new) + q3_ic_new*(q0_wi_new*q2_vw_new + q2_wi_new*q0_vw_new + q1_wi_new*q3_vw_new - q3_wi_new*q1_vw_new))*(q0_ic_old*q0_vw_old + q1_ic_old*q1_vw_old - q2_ic_old*q2_vw_old + q3_ic_old*q3_vw_old) - (q0_ic_new*(q0_wi_new*q2_vw_new + q2_wi_new*q0_vw_new + q1_wi_new*q3_vw_new - q3_wi_new*q1_vw_new) + q1_ic_new*(q0_wi_new*q3_vw_new - q1_wi_new*q2_vw_new + q2_wi_new*q1_vw_new + q3_wi_new*q0_vw_new) - q2_ic_new*(q1_wi_new*q1_vw_new - q0_wi_new*q0_vw_new + q2_wi_new*q2_vw_new + q3_wi_new*q3_vw_new) - q3_ic_new*(q0_wi_new*q1_vw_new + q1_wi_new*q0_vw_new - q2_wi_new*q3_vw_new + q3_wi_new*q2_vw_new))*(q0_ic_old*q3_vw_old + q1_ic_old*q2_vw_old + q2_ic_old*q1_vw_old - q3_ic_old*q0_vw_old) + (q0_ic_new*(q0_wi_new*q3_vw_new - q1_wi_new*q2_vw_new + q2_wi_new*q1_vw_new + q3_wi_new*q0_vw_new) - q1_ic_new*(q0_wi_new*q2_vw_new + q2_wi_new*q0_vw_new + q1_wi_new*q3_vw_new - q3_wi_new*q1_vw_new) + q2_ic_new*(q0_wi_new*q1_vw_new + q1_wi_new*q0_vw_new - q2_wi_new*q3_vw_new + q3_wi_new*q2_vw_new) - q3_ic_new*(q1_wi_new*q1_vw_new - q0_wi_new*q0_vw_new + q2_wi_new*q2_vw_new + q3_wi_new*q3_vw_new))*(q0_ic_old*q2_vw_old + q2_ic_old*q0_vw_old - q1_ic_old*q3_vw_old + q3_ic_old*q1_vw_old), (q0_ic_new*(q0_wi_new*q1_vw_new + q1_wi_new*q0_vw_new - q2_wi_new*q3_vw_new + q3_wi_new*q2_vw_new) - q1_ic_new*(q1_wi_new*q1_vw_new - q0_wi_new*q0_vw_new + q2_wi_new*q2_vw_new + q3_wi_new*q3_vw_new) - q2_ic_new*(q0_wi_new*q3_vw_new - q1_wi_new*q2_vw_new + q2_wi_new*q1_vw_new + q3_wi_new*q0_vw_new) + q3_ic_new*(q0_wi_new*q2_vw_new + q2_wi_new*q0_vw_new + q1_wi_new*q3_vw_new - q3_wi_new*q1_vw_new))*(q0_ic_old*q1_vw_old - q1_ic_old*q0_vw_old + q2_ic_old*q3_vw_old + q3_ic_old*q2_vw_old) - (q0_ic_new*(q1_wi_new*q1_vw_new - q0_wi_new*q0_vw_new + q2_wi_new*q2_vw_new + q3_wi_new*q3_vw_new) + q1_ic_new*(q0_wi_new*q1_vw_new + q1_wi_new*q0_vw_new - q2_wi_new*q3_vw_new + q3_wi_new*q2_vw_new) + q2_ic_new*(q0_wi_new*q2_vw_new + q2_wi_new*q0_vw_new + q1_wi_new*q3_vw_new - q3_wi_new*q1_vw_new) + q3_ic_new*(q0_wi_new*q3_vw_new - q1_wi_new*q2_vw_new + q2_wi_new*q1_vw_new + q3_wi_new*q0_vw_new))*(q0_ic_old*q0_vw_old + q1_ic_old*q1_vw_old + q2_ic_old*q2_vw_old - q3_ic_old*q3_vw_old) - (q0_ic_new*(q0_wi_new*q2_vw_new + q2_wi_new*q0_vw_new + q1_wi_new*q3_vw_new - q3_wi_new*q1_vw_new) + q1_ic_new*(q0_wi_new*q3_vw_new - q1_wi_new*q2_vw_new + q2_wi_new*q1_vw_new + q3_wi_new*q0_vw_new) - q2_ic_new*(q1_wi_new*q1_vw_new - q0_wi_new*q0_vw_new + q2_wi_new*q2_vw_new + q3_wi_new*q3_vw_new) - q3_ic_new*(q0_wi_new*q1_vw_new + q1_wi_new*q0_vw_new - q2_wi_new*q3_vw_new + q3_wi_new*q2_vw_new))*(q2_ic_old*q0_vw_old - q0_ic_old*q2_vw_old + q1_ic_old*q3_vw_old + q3_ic_old*q1_vw_old) + (q0_ic_new*(q0_wi_new*q3_vw_new - q1_wi_new*q2_vw_new + q2_wi_new*q1_vw_new + q3_wi_new*q0_vw_new) - q1_ic_new*(q0_wi_new*q2_vw_new + q2_wi_new*q0_vw_new + q1_wi_new*q3_vw_new - q3_wi_new*q1_vw_new) + q2_ic_new*(q0_wi_new*q1_vw_new + q1_wi_new*q0_vw_new - q2_wi_new*q3_vw_new + q3_wi_new*q2_vw_new) - q3_ic_new*(q1_wi_new*q1_vw_new - q0_wi_new*q0_vw_new + q2_wi_new*q2_vw_new + q3_wi_new*q3_vw_new))*(q0_ic_old*q3_vw_old + q1_ic_old*q2_vw_old - q2_ic_old*q1_vw_old + q3_ic_old*q0_vw_old)]];

% qHk(q_ic) = delta(z_q_relative) / delta(q_ic_k)
if (param.fusion.camFixQuatic == 0)
    H_z_q_relative_qic_old = [[ (q0_ic_new*(q1_wi_new*q1_vw_new - q0_wi_new*q0_vw_new + q2_wi_new*q2_vw_new + q3_wi_new*q3_vw_new) + q1_ic_new*(q0_wi_new*q1_vw_new + q1_wi_new*q0_vw_new - q2_wi_new*q3_vw_new + q3_wi_new*q2_vw_new) + q2_ic_new*(q0_wi_new*q2_vw_new + q2_wi_new*q0_vw_new + q1_wi_new*q3_vw_new - q3_wi_new*q1_vw_new) + q3_ic_new*(q0_wi_new*q3_vw_new - q1_wi_new*q2_vw_new + q2_wi_new*q1_vw_new + q3_wi_new*q0_vw_new))*(q1_wi_old*q1_vw_old - q0_wi_old*q0_vw_old + q2_wi_old*q2_vw_old + q3_wi_old*q3_vw_old) + (q0_ic_new*(q0_wi_new*q1_vw_new + q1_wi_new*q0_vw_new - q2_wi_new*q3_vw_new + q3_wi_new*q2_vw_new) - q1_ic_new*(q1_wi_new*q1_vw_new - q0_wi_new*q0_vw_new + q2_wi_new*q2_vw_new + q3_wi_new*q3_vw_new) - q2_ic_new*(q0_wi_new*q3_vw_new - q1_wi_new*q2_vw_new + q2_wi_new*q1_vw_new + q3_wi_new*q0_vw_new) + q3_ic_new*(q0_wi_new*q2_vw_new + q2_wi_new*q0_vw_new + q1_wi_new*q3_vw_new - q3_wi_new*q1_vw_new))*(q0_wi_old*q1_vw_old + q1_wi_old*q0_vw_old - q2_wi_old*q3_vw_old + q3_wi_old*q2_vw_old) + (q0_ic_new*(q0_wi_new*q2_vw_new + q2_wi_new*q0_vw_new + q1_wi_new*q3_vw_new - q3_wi_new*q1_vw_new) + q1_ic_new*(q0_wi_new*q3_vw_new - q1_wi_new*q2_vw_new + q2_wi_new*q1_vw_new + q3_wi_new*q0_vw_new) - q2_ic_new*(q1_wi_new*q1_vw_new - q0_wi_new*q0_vw_new + q2_wi_new*q2_vw_new + q3_wi_new*q3_vw_new) - q3_ic_new*(q0_wi_new*q1_vw_new + q1_wi_new*q0_vw_new - q2_wi_new*q3_vw_new + q3_wi_new*q2_vw_new))*(q0_wi_old*q2_vw_old + q2_wi_old*q0_vw_old + q1_wi_old*q3_vw_old - q3_wi_old*q1_vw_old) + (q0_ic_new*(q0_wi_new*q3_vw_new - q1_wi_new*q2_vw_new + q2_wi_new*q1_vw_new + q3_wi_new*q0_vw_new) - q1_ic_new*(q0_wi_new*q2_vw_new + q2_wi_new*q0_vw_new + q1_wi_new*q3_vw_new - q3_wi_new*q1_vw_new) + q2_ic_new*(q0_wi_new*q1_vw_new + q1_wi_new*q0_vw_new - q2_wi_new*q3_vw_new + q3_wi_new*q2_vw_new) - q3_ic_new*(q1_wi_new*q1_vw_new - q0_wi_new*q0_vw_new + q2_wi_new*q2_vw_new + q3_wi_new*q3_vw_new))*(q0_wi_old*q3_vw_old - q1_wi_old*q2_vw_old + q2_wi_old*q1_vw_old + q3_wi_old*q0_vw_old), (q0_ic_new*(q1_wi_new*q1_vw_new - q0_wi_new*q0_vw_new + q2_wi_new*q2_vw_new + q3_wi_new*q3_vw_new) + q1_ic_new*(q0_wi_new*q1_vw_new + q1_wi_new*q0_vw_new - q2_wi_new*q3_vw_new + q3_wi_new*q2_vw_new) + q2_ic_new*(q0_wi_new*q2_vw_new + q2_wi_new*q0_vw_new + q1_wi_new*q3_vw_new - q3_wi_new*q1_vw_new) + q3_ic_new*(q0_wi_new*q3_vw_new - q1_wi_new*q2_vw_new + q2_wi_new*q1_vw_new + q3_wi_new*q0_vw_new))*(q0_wi_old*q1_vw_old + q1_wi_old*q0_vw_old - q2_wi_old*q3_vw_old + q3_wi_old*q2_vw_old) - (q0_ic_new*(q0_wi_new*q1_vw_new + q1_wi_new*q0_vw_new - q2_wi_new*q3_vw_new + q3_wi_new*q2_vw_new) - q1_ic_new*(q1_wi_new*q1_vw_new - q0_wi_new*q0_vw_new + q2_wi_new*q2_vw_new + q3_wi_new*q3_vw_new) - q2_ic_new*(q0_wi_new*q3_vw_new - q1_wi_new*q2_vw_new + q2_wi_new*q1_vw_new + q3_wi_new*q0_vw_new) + q3_ic_new*(q0_wi_new*q2_vw_new + q2_wi_new*q0_vw_new + q1_wi_new*q3_vw_new - q3_wi_new*q1_vw_new))*(q1_wi_old*q1_vw_old - q0_wi_old*q0_vw_old + q2_wi_old*q2_vw_old + q3_wi_old*q3_vw_old) + (q0_ic_new*(q0_wi_new*q2_vw_new + q2_wi_new*q0_vw_new + q1_wi_new*q3_vw_new - q3_wi_new*q1_vw_new) + q1_ic_new*(q0_wi_new*q3_vw_new - q1_wi_new*q2_vw_new + q2_wi_new*q1_vw_new + q3_wi_new*q0_vw_new) - q2_ic_new*(q1_wi_new*q1_vw_new - q0_wi_new*q0_vw_new + q2_wi_new*q2_vw_new + q3_wi_new*q3_vw_new) - q3_ic_new*(q0_wi_new*q1_vw_new + q1_wi_new*q0_vw_new - q2_wi_new*q3_vw_new + q3_wi_new*q2_vw_new))*(q0_wi_old*q3_vw_old - q1_wi_old*q2_vw_old + q2_wi_old*q1_vw_old + q3_wi_old*q0_vw_old) - (q0_ic_new*(q0_wi_new*q3_vw_new - q1_wi_new*q2_vw_new + q2_wi_new*q1_vw_new + q3_wi_new*q0_vw_new) - q1_ic_new*(q0_wi_new*q2_vw_new + q2_wi_new*q0_vw_new + q1_wi_new*q3_vw_new - q3_wi_new*q1_vw_new) + q2_ic_new*(q0_wi_new*q1_vw_new + q1_wi_new*q0_vw_new - q2_wi_new*q3_vw_new + q3_wi_new*q2_vw_new) - q3_ic_new*(q1_wi_new*q1_vw_new - q0_wi_new*q0_vw_new + q2_wi_new*q2_vw_new + q3_wi_new*q3_vw_new))*(q0_wi_old*q2_vw_old + q2_wi_old*q0_vw_old + q1_wi_old*q3_vw_old - q3_wi_old*q1_vw_old), (q0_ic_new*(q1_wi_new*q1_vw_new - q0_wi_new*q0_vw_new + q2_wi_new*q2_vw_new + q3_wi_new*q3_vw_new) + q1_ic_new*(q0_wi_new*q1_vw_new + q1_wi_new*q0_vw_new - q2_wi_new*q3_vw_new + q3_wi_new*q2_vw_new) + q2_ic_new*(q0_wi_new*q2_vw_new + q2_wi_new*q0_vw_new + q1_wi_new*q3_vw_new - q3_wi_new*q1_vw_new) + q3_ic_new*(q0_wi_new*q3_vw_new - q1_wi_new*q2_vw_new + q2_wi_new*q1_vw_new + q3_wi_new*q0_vw_new))*(q0_wi_old*q2_vw_old + q2_wi_old*q0_vw_old + q1_wi_old*q3_vw_old - q3_wi_old*q1_vw_old) - (q0_ic_new*(q0_wi_new*q1_vw_new + q1_wi_new*q0_vw_new - q2_wi_new*q3_vw_new + q3_wi_new*q2_vw_new) - q1_ic_new*(q1_wi_new*q1_vw_new - q0_wi_new*q0_vw_new + q2_wi_new*q2_vw_new + q3_wi_new*q3_vw_new) - q2_ic_new*(q0_wi_new*q3_vw_new - q1_wi_new*q2_vw_new + q2_wi_new*q1_vw_new + q3_wi_new*q0_vw_new) + q3_ic_new*(q0_wi_new*q2_vw_new + q2_wi_new*q0_vw_new + q1_wi_new*q3_vw_new - q3_wi_new*q1_vw_new))*(q0_wi_old*q3_vw_old - q1_wi_old*q2_vw_old + q2_wi_old*q1_vw_old + q3_wi_old*q0_vw_old) - (q0_ic_new*(q0_wi_new*q2_vw_new + q2_wi_new*q0_vw_new + q1_wi_new*q3_vw_new - q3_wi_new*q1_vw_new) + q1_ic_new*(q0_wi_new*q3_vw_new - q1_wi_new*q2_vw_new + q2_wi_new*q1_vw_new + q3_wi_new*q0_vw_new) - q2_ic_new*(q1_wi_new*q1_vw_new - q0_wi_new*q0_vw_new + q2_wi_new*q2_vw_new + q3_wi_new*q3_vw_new) - q3_ic_new*(q0_wi_new*q1_vw_new + q1_wi_new*q0_vw_new - q2_wi_new*q3_vw_new + q3_wi_new*q2_vw_new))*(q1_wi_old*q1_vw_old - q0_wi_old*q0_vw_old + q2_wi_old*q2_vw_old + q3_wi_old*q3_vw_old) + (q0_ic_new*(q0_wi_new*q3_vw_new - q1_wi_new*q2_vw_new + q2_wi_new*q1_vw_new + q3_wi_new*q0_vw_new) - q1_ic_new*(q0_wi_new*q2_vw_new + q2_wi_new*q0_vw_new + q1_wi_new*q3_vw_new - q3_wi_new*q1_vw_new) + q2_ic_new*(q0_wi_new*q1_vw_new + q1_wi_new*q0_vw_new - q2_wi_new*q3_vw_new + q3_wi_new*q2_vw_new) - q3_ic_new*(q1_wi_new*q1_vw_new - q0_wi_new*q0_vw_new + q2_wi_new*q2_vw_new + q3_wi_new*q3_vw_new))*(q0_wi_old*q1_vw_old + q1_wi_old*q0_vw_old - q2_wi_old*q3_vw_old + q3_wi_old*q2_vw_old), (q0_ic_new*(q1_wi_new*q1_vw_new - q0_wi_new*q0_vw_new + q2_wi_new*q2_vw_new + q3_wi_new*q3_vw_new) + q1_ic_new*(q0_wi_new*q1_vw_new + q1_wi_new*q0_vw_new - q2_wi_new*q3_vw_new + q3_wi_new*q2_vw_new) + q2_ic_new*(q0_wi_new*q2_vw_new + q2_wi_new*q0_vw_new + q1_wi_new*q3_vw_new - q3_wi_new*q1_vw_new) + q3_ic_new*(q0_wi_new*q3_vw_new - q1_wi_new*q2_vw_new + q2_wi_new*q1_vw_new + q3_wi_new*q0_vw_new))*(q0_wi_old*q3_vw_old - q1_wi_old*q2_vw_old + q2_wi_old*q1_vw_old + q3_wi_old*q0_vw_old) + (q0_ic_new*(q0_wi_new*q1_vw_new + q1_wi_new*q0_vw_new - q2_wi_new*q3_vw_new + q3_wi_new*q2_vw_new) - q1_ic_new*(q1_wi_new*q1_vw_new - q0_wi_new*q0_vw_new + q2_wi_new*q2_vw_new + q3_wi_new*q3_vw_new) - q2_ic_new*(q0_wi_new*q3_vw_new - q1_wi_new*q2_vw_new + q2_wi_new*q1_vw_new + q3_wi_new*q0_vw_new) + q3_ic_new*(q0_wi_new*q2_vw_new + q2_wi_new*q0_vw_new + q1_wi_new*q3_vw_new - q3_wi_new*q1_vw_new))*(q0_wi_old*q2_vw_old + q2_wi_old*q0_vw_old + q1_wi_old*q3_vw_old - q3_wi_old*q1_vw_old) - (q0_ic_new*(q0_wi_new*q2_vw_new + q2_wi_new*q0_vw_new + q1_wi_new*q3_vw_new - q3_wi_new*q1_vw_new) + q1_ic_new*(q0_wi_new*q3_vw_new - q1_wi_new*q2_vw_new + q2_wi_new*q1_vw_new + q3_wi_new*q0_vw_new) - q2_ic_new*(q1_wi_new*q1_vw_new - q0_wi_new*q0_vw_new + q2_wi_new*q2_vw_new + q3_wi_new*q3_vw_new) - q3_ic_new*(q0_wi_new*q1_vw_new + q1_wi_new*q0_vw_new - q2_wi_new*q3_vw_new + q3_wi_new*q2_vw_new))*(q0_wi_old*q1_vw_old + q1_wi_old*q0_vw_old - q2_wi_old*q3_vw_old + q3_wi_old*q2_vw_old) - (q0_ic_new*(q0_wi_new*q3_vw_new - q1_wi_new*q2_vw_new + q2_wi_new*q1_vw_new + q3_wi_new*q0_vw_new) - q1_ic_new*(q0_wi_new*q2_vw_new + q2_wi_new*q0_vw_new + q1_wi_new*q3_vw_new - q3_wi_new*q1_vw_new) + q2_ic_new*(q0_wi_new*q1_vw_new + q1_wi_new*q0_vw_new - q2_wi_new*q3_vw_new + q3_wi_new*q2_vw_new) - q3_ic_new*(q1_wi_new*q1_vw_new - q0_wi_new*q0_vw_new + q2_wi_new*q2_vw_new + q3_wi_new*q3_vw_new))*(q1_wi_old*q1_vw_old - q0_wi_old*q0_vw_old + q2_wi_old*q2_vw_old + q3_wi_old*q3_vw_old)]
                              [ (q0_ic_new*(q0_wi_new*q1_vw_new + q1_wi_new*q0_vw_new - q2_wi_new*q3_vw_new + q3_wi_new*q2_vw_new) - q1_ic_new*(q1_wi_new*q1_vw_new - q0_wi_new*q0_vw_new + q2_wi_new*q2_vw_new + q3_wi_new*q3_vw_new) - q2_ic_new*(q0_wi_new*q3_vw_new - q1_wi_new*q2_vw_new + q2_wi_new*q1_vw_new + q3_wi_new*q0_vw_new) + q3_ic_new*(q0_wi_new*q2_vw_new + q2_wi_new*q0_vw_new + q1_wi_new*q3_vw_new - q3_wi_new*q1_vw_new))*(q1_wi_old*q1_vw_old - q0_wi_old*q0_vw_old + q2_wi_old*q2_vw_old + q3_wi_old*q3_vw_old) - (q0_ic_new*(q1_wi_new*q1_vw_new - q0_wi_new*q0_vw_new + q2_wi_new*q2_vw_new + q3_wi_new*q3_vw_new) + q1_ic_new*(q0_wi_new*q1_vw_new + q1_wi_new*q0_vw_new - q2_wi_new*q3_vw_new + q3_wi_new*q2_vw_new) + q2_ic_new*(q0_wi_new*q2_vw_new + q2_wi_new*q0_vw_new + q1_wi_new*q3_vw_new - q3_wi_new*q1_vw_new) + q3_ic_new*(q0_wi_new*q3_vw_new - q1_wi_new*q2_vw_new + q2_wi_new*q1_vw_new + q3_wi_new*q0_vw_new))*(q0_wi_old*q1_vw_old + q1_wi_old*q0_vw_old - q2_wi_old*q3_vw_old + q3_wi_old*q2_vw_old) - (q0_ic_new*(q0_wi_new*q2_vw_new + q2_wi_new*q0_vw_new + q1_wi_new*q3_vw_new - q3_wi_new*q1_vw_new) + q1_ic_new*(q0_wi_new*q3_vw_new - q1_wi_new*q2_vw_new + q2_wi_new*q1_vw_new + q3_wi_new*q0_vw_new) - q2_ic_new*(q1_wi_new*q1_vw_new - q0_wi_new*q0_vw_new + q2_wi_new*q2_vw_new + q3_wi_new*q3_vw_new) - q3_ic_new*(q0_wi_new*q1_vw_new + q1_wi_new*q0_vw_new - q2_wi_new*q3_vw_new + q3_wi_new*q2_vw_new))*(q0_wi_old*q3_vw_old - q1_wi_old*q2_vw_old + q2_wi_old*q1_vw_old + q3_wi_old*q0_vw_old) + (q0_ic_new*(q0_wi_new*q3_vw_new - q1_wi_new*q2_vw_new + q2_wi_new*q1_vw_new + q3_wi_new*q0_vw_new) - q1_ic_new*(q0_wi_new*q2_vw_new + q2_wi_new*q0_vw_new + q1_wi_new*q3_vw_new - q3_wi_new*q1_vw_new) + q2_ic_new*(q0_wi_new*q1_vw_new + q1_wi_new*q0_vw_new - q2_wi_new*q3_vw_new + q3_wi_new*q2_vw_new) - q3_ic_new*(q1_wi_new*q1_vw_new - q0_wi_new*q0_vw_new + q2_wi_new*q2_vw_new + q3_wi_new*q3_vw_new))*(q0_wi_old*q2_vw_old + q2_wi_old*q0_vw_old + q1_wi_old*q3_vw_old - q3_wi_old*q1_vw_old), (q0_ic_new*(q1_wi_new*q1_vw_new - q0_wi_new*q0_vw_new + q2_wi_new*q2_vw_new + q3_wi_new*q3_vw_new) + q1_ic_new*(q0_wi_new*q1_vw_new + q1_wi_new*q0_vw_new - q2_wi_new*q3_vw_new + q3_wi_new*q2_vw_new) + q2_ic_new*(q0_wi_new*q2_vw_new + q2_wi_new*q0_vw_new + q1_wi_new*q3_vw_new - q3_wi_new*q1_vw_new) + q3_ic_new*(q0_wi_new*q3_vw_new - q1_wi_new*q2_vw_new + q2_wi_new*q1_vw_new + q3_wi_new*q0_vw_new))*(q1_wi_old*q1_vw_old - q0_wi_old*q0_vw_old + q2_wi_old*q2_vw_old + q3_wi_old*q3_vw_old) + (q0_ic_new*(q0_wi_new*q1_vw_new + q1_wi_new*q0_vw_new - q2_wi_new*q3_vw_new + q3_wi_new*q2_vw_new) - q1_ic_new*(q1_wi_new*q1_vw_new - q0_wi_new*q0_vw_new + q2_wi_new*q2_vw_new + q3_wi_new*q3_vw_new) - q2_ic_new*(q0_wi_new*q3_vw_new - q1_wi_new*q2_vw_new + q2_wi_new*q1_vw_new + q3_wi_new*q0_vw_new) + q3_ic_new*(q0_wi_new*q2_vw_new + q2_wi_new*q0_vw_new + q1_wi_new*q3_vw_new - q3_wi_new*q1_vw_new))*(q0_wi_old*q1_vw_old + q1_wi_old*q0_vw_old - q2_wi_old*q3_vw_old + q3_wi_old*q2_vw_old) + (q0_ic_new*(q0_wi_new*q2_vw_new + q2_wi_new*q0_vw_new + q1_wi_new*q3_vw_new - q3_wi_new*q1_vw_new) + q1_ic_new*(q0_wi_new*q3_vw_new - q1_wi_new*q2_vw_new + q2_wi_new*q1_vw_new + q3_wi_new*q0_vw_new) - q2_ic_new*(q1_wi_new*q1_vw_new - q0_wi_new*q0_vw_new + q2_wi_new*q2_vw_new + q3_wi_new*q3_vw_new) - q3_ic_new*(q0_wi_new*q1_vw_new + q1_wi_new*q0_vw_new - q2_wi_new*q3_vw_new + q3_wi_new*q2_vw_new))*(q0_wi_old*q2_vw_old + q2_wi_old*q0_vw_old + q1_wi_old*q3_vw_old - q3_wi_old*q1_vw_old) + (q0_ic_new*(q0_wi_new*q3_vw_new - q1_wi_new*q2_vw_new + q2_wi_new*q1_vw_new + q3_wi_new*q0_vw_new) - q1_ic_new*(q0_wi_new*q2_vw_new + q2_wi_new*q0_vw_new + q1_wi_new*q3_vw_new - q3_wi_new*q1_vw_new) + q2_ic_new*(q0_wi_new*q1_vw_new + q1_wi_new*q0_vw_new - q2_wi_new*q3_vw_new + q3_wi_new*q2_vw_new) - q3_ic_new*(q1_wi_new*q1_vw_new - q0_wi_new*q0_vw_new + q2_wi_new*q2_vw_new + q3_wi_new*q3_vw_new))*(q0_wi_old*q3_vw_old - q1_wi_old*q2_vw_old + q2_wi_old*q1_vw_old + q3_wi_old*q0_vw_old), (q0_ic_new*(q1_wi_new*q1_vw_new - q0_wi_new*q0_vw_new + q2_wi_new*q2_vw_new + q3_wi_new*q3_vw_new) + q1_ic_new*(q0_wi_new*q1_vw_new + q1_wi_new*q0_vw_new - q2_wi_new*q3_vw_new + q3_wi_new*q2_vw_new) + q2_ic_new*(q0_wi_new*q2_vw_new + q2_wi_new*q0_vw_new + q1_wi_new*q3_vw_new - q3_wi_new*q1_vw_new) + q3_ic_new*(q0_wi_new*q3_vw_new - q1_wi_new*q2_vw_new + q2_wi_new*q1_vw_new + q3_wi_new*q0_vw_new))*(q0_wi_old*q3_vw_old - q1_wi_old*q2_vw_old + q2_wi_old*q1_vw_old + q3_wi_old*q0_vw_old) + (q0_ic_new*(q0_wi_new*q1_vw_new + q1_wi_new*q0_vw_new - q2_wi_new*q3_vw_new + q3_wi_new*q2_vw_new) - q1_ic_new*(q1_wi_new*q1_vw_new - q0_wi_new*q0_vw_new + q2_wi_new*q2_vw_new + q3_wi_new*q3_vw_new) - q2_ic_new*(q0_wi_new*q3_vw_new - q1_wi_new*q2_vw_new + q2_wi_new*q1_vw_new + q3_wi_new*q0_vw_new) + q3_ic_new*(q0_wi_new*q2_vw_new + q2_wi_new*q0_vw_new + q1_wi_new*q3_vw_new - q3_wi_new*q1_vw_new))*(q0_wi_old*q2_vw_old + q2_wi_old*q0_vw_old + q1_wi_old*q3_vw_old - q3_wi_old*q1_vw_old) - (q0_ic_new*(q0_wi_new*q2_vw_new + q2_wi_new*q0_vw_new + q1_wi_new*q3_vw_new - q3_wi_new*q1_vw_new) + q1_ic_new*(q0_wi_new*q3_vw_new - q1_wi_new*q2_vw_new + q2_wi_new*q1_vw_new + q3_wi_new*q0_vw_new) - q2_ic_new*(q1_wi_new*q1_vw_new - q0_wi_new*q0_vw_new + q2_wi_new*q2_vw_new + q3_wi_new*q3_vw_new) - q3_ic_new*(q0_wi_new*q1_vw_new + q1_wi_new*q0_vw_new - q2_wi_new*q3_vw_new + q3_wi_new*q2_vw_new))*(q0_wi_old*q1_vw_old + q1_wi_old*q0_vw_old - q2_wi_old*q3_vw_old + q3_wi_old*q2_vw_old) - (q0_ic_new*(q0_wi_new*q3_vw_new - q1_wi_new*q2_vw_new + q2_wi_new*q1_vw_new + q3_wi_new*q0_vw_new) - q1_ic_new*(q0_wi_new*q2_vw_new + q2_wi_new*q0_vw_new + q1_wi_new*q3_vw_new - q3_wi_new*q1_vw_new) + q2_ic_new*(q0_wi_new*q1_vw_new + q1_wi_new*q0_vw_new - q2_wi_new*q3_vw_new + q3_wi_new*q2_vw_new) - q3_ic_new*(q1_wi_new*q1_vw_new - q0_wi_new*q0_vw_new + q2_wi_new*q2_vw_new + q3_wi_new*q3_vw_new))*(q1_wi_old*q1_vw_old - q0_wi_old*q0_vw_old + q2_wi_old*q2_vw_old + q3_wi_old*q3_vw_old), (q0_ic_new*(q0_wi_new*q1_vw_new + q1_wi_new*q0_vw_new - q2_wi_new*q3_vw_new + q3_wi_new*q2_vw_new) - q1_ic_new*(q1_wi_new*q1_vw_new - q0_wi_new*q0_vw_new + q2_wi_new*q2_vw_new + q3_wi_new*q3_vw_new) - q2_ic_new*(q0_wi_new*q3_vw_new - q1_wi_new*q2_vw_new + q2_wi_new*q1_vw_new + q3_wi_new*q0_vw_new) + q3_ic_new*(q0_wi_new*q2_vw_new + q2_wi_new*q0_vw_new + q1_wi_new*q3_vw_new - q3_wi_new*q1_vw_new))*(q0_wi_old*q3_vw_old - q1_wi_old*q2_vw_old + q2_wi_old*q1_vw_old + q3_wi_old*q0_vw_old) - (q0_ic_new*(q1_wi_new*q1_vw_new - q0_wi_new*q0_vw_new + q2_wi_new*q2_vw_new + q3_wi_new*q3_vw_new) + q1_ic_new*(q0_wi_new*q1_vw_new + q1_wi_new*q0_vw_new - q2_wi_new*q3_vw_new + q3_wi_new*q2_vw_new) + q2_ic_new*(q0_wi_new*q2_vw_new + q2_wi_new*q0_vw_new + q1_wi_new*q3_vw_new - q3_wi_new*q1_vw_new) + q3_ic_new*(q0_wi_new*q3_vw_new - q1_wi_new*q2_vw_new + q2_wi_new*q1_vw_new + q3_wi_new*q0_vw_new))*(q0_wi_old*q2_vw_old + q2_wi_old*q0_vw_old + q1_wi_old*q3_vw_old - q3_wi_old*q1_vw_old) + (q0_ic_new*(q0_wi_new*q2_vw_new + q2_wi_new*q0_vw_new + q1_wi_new*q3_vw_new - q3_wi_new*q1_vw_new) + q1_ic_new*(q0_wi_new*q3_vw_new - q1_wi_new*q2_vw_new + q2_wi_new*q1_vw_new + q3_wi_new*q0_vw_new) - q2_ic_new*(q1_wi_new*q1_vw_new - q0_wi_new*q0_vw_new + q2_wi_new*q2_vw_new + q3_wi_new*q3_vw_new) - q3_ic_new*(q0_wi_new*q1_vw_new + q1_wi_new*q0_vw_new - q2_wi_new*q3_vw_new + q3_wi_new*q2_vw_new))*(q1_wi_old*q1_vw_old - q0_wi_old*q0_vw_old + q2_wi_old*q2_vw_old + q3_wi_old*q3_vw_old) - (q0_ic_new*(q0_wi_new*q3_vw_new - q1_wi_new*q2_vw_new + q2_wi_new*q1_vw_new + q3_wi_new*q0_vw_new) - q1_ic_new*(q0_wi_new*q2_vw_new + q2_wi_new*q0_vw_new + q1_wi_new*q3_vw_new - q3_wi_new*q1_vw_new) + q2_ic_new*(q0_wi_new*q1_vw_new + q1_wi_new*q0_vw_new - q2_wi_new*q3_vw_new + q3_wi_new*q2_vw_new) - q3_ic_new*(q1_wi_new*q1_vw_new - q0_wi_new*q0_vw_new + q2_wi_new*q2_vw_new + q3_wi_new*q3_vw_new))*(q0_wi_old*q1_vw_old + q1_wi_old*q0_vw_old - q2_wi_old*q3_vw_old + q3_wi_old*q2_vw_old)]
                              [ (q0_ic_new*(q0_wi_new*q1_vw_new + q1_wi_new*q0_vw_new - q2_wi_new*q3_vw_new + q3_wi_new*q2_vw_new) - q1_ic_new*(q1_wi_new*q1_vw_new - q0_wi_new*q0_vw_new + q2_wi_new*q2_vw_new + q3_wi_new*q3_vw_new) - q2_ic_new*(q0_wi_new*q3_vw_new - q1_wi_new*q2_vw_new + q2_wi_new*q1_vw_new + q3_wi_new*q0_vw_new) + q3_ic_new*(q0_wi_new*q2_vw_new + q2_wi_new*q0_vw_new + q1_wi_new*q3_vw_new - q3_wi_new*q1_vw_new))*(q0_wi_old*q3_vw_old - q1_wi_old*q2_vw_old + q2_wi_old*q1_vw_old + q3_wi_old*q0_vw_old) - (q0_ic_new*(q1_wi_new*q1_vw_new - q0_wi_new*q0_vw_new + q2_wi_new*q2_vw_new + q3_wi_new*q3_vw_new) + q1_ic_new*(q0_wi_new*q1_vw_new + q1_wi_new*q0_vw_new - q2_wi_new*q3_vw_new + q3_wi_new*q2_vw_new) + q2_ic_new*(q0_wi_new*q2_vw_new + q2_wi_new*q0_vw_new + q1_wi_new*q3_vw_new - q3_wi_new*q1_vw_new) + q3_ic_new*(q0_wi_new*q3_vw_new - q1_wi_new*q2_vw_new + q2_wi_new*q1_vw_new + q3_wi_new*q0_vw_new))*(q0_wi_old*q2_vw_old + q2_wi_old*q0_vw_old + q1_wi_old*q3_vw_old - q3_wi_old*q1_vw_old) + (q0_ic_new*(q0_wi_new*q2_vw_new + q2_wi_new*q0_vw_new + q1_wi_new*q3_vw_new - q3_wi_new*q1_vw_new) + q1_ic_new*(q0_wi_new*q3_vw_new - q1_wi_new*q2_vw_new + q2_wi_new*q1_vw_new + q3_wi_new*q0_vw_new) - q2_ic_new*(q1_wi_new*q1_vw_new - q0_wi_new*q0_vw_new + q2_wi_new*q2_vw_new + q3_wi_new*q3_vw_new) - q3_ic_new*(q0_wi_new*q1_vw_new + q1_wi_new*q0_vw_new - q2_wi_new*q3_vw_new + q3_wi_new*q2_vw_new))*(q1_wi_old*q1_vw_old - q0_wi_old*q0_vw_old + q2_wi_old*q2_vw_old + q3_wi_old*q3_vw_old) - (q0_ic_new*(q0_wi_new*q3_vw_new - q1_wi_new*q2_vw_new + q2_wi_new*q1_vw_new + q3_wi_new*q0_vw_new) - q1_ic_new*(q0_wi_new*q2_vw_new + q2_wi_new*q0_vw_new + q1_wi_new*q3_vw_new - q3_wi_new*q1_vw_new) + q2_ic_new*(q0_wi_new*q1_vw_new + q1_wi_new*q0_vw_new - q2_wi_new*q3_vw_new + q3_wi_new*q2_vw_new) - q3_ic_new*(q1_wi_new*q1_vw_new - q0_wi_new*q0_vw_new + q2_wi_new*q2_vw_new + q3_wi_new*q3_vw_new))*(q0_wi_old*q1_vw_old + q1_wi_old*q0_vw_old - q2_wi_old*q3_vw_old + q3_wi_old*q2_vw_old), (q0_ic_new*(q0_wi_new*q2_vw_new + q2_wi_new*q0_vw_new + q1_wi_new*q3_vw_new - q3_wi_new*q1_vw_new) + q1_ic_new*(q0_wi_new*q3_vw_new - q1_wi_new*q2_vw_new + q2_wi_new*q1_vw_new + q3_wi_new*q0_vw_new) - q2_ic_new*(q1_wi_new*q1_vw_new - q0_wi_new*q0_vw_new + q2_wi_new*q2_vw_new + q3_wi_new*q3_vw_new) - q3_ic_new*(q0_wi_new*q1_vw_new + q1_wi_new*q0_vw_new - q2_wi_new*q3_vw_new + q3_wi_new*q2_vw_new))*(q0_wi_old*q1_vw_old + q1_wi_old*q0_vw_old - q2_wi_old*q3_vw_old + q3_wi_old*q2_vw_old) - (q0_ic_new*(q0_wi_new*q1_vw_new + q1_wi_new*q0_vw_new - q2_wi_new*q3_vw_new + q3_wi_new*q2_vw_new) - q1_ic_new*(q1_wi_new*q1_vw_new - q0_wi_new*q0_vw_new + q2_wi_new*q2_vw_new + q3_wi_new*q3_vw_new) - q2_ic_new*(q0_wi_new*q3_vw_new - q1_wi_new*q2_vw_new + q2_wi_new*q1_vw_new + q3_wi_new*q0_vw_new) + q3_ic_new*(q0_wi_new*q2_vw_new + q2_wi_new*q0_vw_new + q1_wi_new*q3_vw_new - q3_wi_new*q1_vw_new))*(q0_wi_old*q2_vw_old + q2_wi_old*q0_vw_old + q1_wi_old*q3_vw_old - q3_wi_old*q1_vw_old) - (q0_ic_new*(q1_wi_new*q1_vw_new - q0_wi_new*q0_vw_new + q2_wi_new*q2_vw_new + q3_wi_new*q3_vw_new) + q1_ic_new*(q0_wi_new*q1_vw_new + q1_wi_new*q0_vw_new - q2_wi_new*q3_vw_new + q3_wi_new*q2_vw_new) + q2_ic_new*(q0_wi_new*q2_vw_new + q2_wi_new*q0_vw_new + q1_wi_new*q3_vw_new - q3_wi_new*q1_vw_new) + q3_ic_new*(q0_wi_new*q3_vw_new - q1_wi_new*q2_vw_new + q2_wi_new*q1_vw_new + q3_wi_new*q0_vw_new))*(q0_wi_old*q3_vw_old - q1_wi_old*q2_vw_old + q2_wi_old*q1_vw_old + q3_wi_old*q0_vw_old) + (q0_ic_new*(q0_wi_new*q3_vw_new - q1_wi_new*q2_vw_new + q2_wi_new*q1_vw_new + q3_wi_new*q0_vw_new) - q1_ic_new*(q0_wi_new*q2_vw_new + q2_wi_new*q0_vw_new + q1_wi_new*q3_vw_new - q3_wi_new*q1_vw_new) + q2_ic_new*(q0_wi_new*q1_vw_new + q1_wi_new*q0_vw_new - q2_wi_new*q3_vw_new + q3_wi_new*q2_vw_new) - q3_ic_new*(q1_wi_new*q1_vw_new - q0_wi_new*q0_vw_new + q2_wi_new*q2_vw_new + q3_wi_new*q3_vw_new))*(q1_wi_old*q1_vw_old - q0_wi_old*q0_vw_old + q2_wi_old*q2_vw_old + q3_wi_old*q3_vw_old), (q0_ic_new*(q1_wi_new*q1_vw_new - q0_wi_new*q0_vw_new + q2_wi_new*q2_vw_new + q3_wi_new*q3_vw_new) + q1_ic_new*(q0_wi_new*q1_vw_new + q1_wi_new*q0_vw_new - q2_wi_new*q3_vw_new + q3_wi_new*q2_vw_new) + q2_ic_new*(q0_wi_new*q2_vw_new + q2_wi_new*q0_vw_new + q1_wi_new*q3_vw_new - q3_wi_new*q1_vw_new) + q3_ic_new*(q0_wi_new*q3_vw_new - q1_wi_new*q2_vw_new + q2_wi_new*q1_vw_new + q3_wi_new*q0_vw_new))*(q1_wi_old*q1_vw_old - q0_wi_old*q0_vw_old + q2_wi_old*q2_vw_old + q3_wi_old*q3_vw_old) + (q0_ic_new*(q0_wi_new*q1_vw_new + q1_wi_new*q0_vw_new - q2_wi_new*q3_vw_new + q3_wi_new*q2_vw_new) - q1_ic_new*(q1_wi_new*q1_vw_new - q0_wi_new*q0_vw_new + q2_wi_new*q2_vw_new + q3_wi_new*q3_vw_new) - q2_ic_new*(q0_wi_new*q3_vw_new - q1_wi_new*q2_vw_new + q2_wi_new*q1_vw_new + q3_wi_new*q0_vw_new) + q3_ic_new*(q0_wi_new*q2_vw_new + q2_wi_new*q0_vw_new + q1_wi_new*q3_vw_new - q3_wi_new*q1_vw_new))*(q0_wi_old*q1_vw_old + q1_wi_old*q0_vw_old - q2_wi_old*q3_vw_old + q3_wi_old*q2_vw_old) + (q0_ic_new*(q0_wi_new*q2_vw_new + q2_wi_new*q0_vw_new + q1_wi_new*q3_vw_new - q3_wi_new*q1_vw_new) + q1_ic_new*(q0_wi_new*q3_vw_new - q1_wi_new*q2_vw_new + q2_wi_new*q1_vw_new + q3_wi_new*q0_vw_new) - q2_ic_new*(q1_wi_new*q1_vw_new - q0_wi_new*q0_vw_new + q2_wi_new*q2_vw_new + q3_wi_new*q3_vw_new) - q3_ic_new*(q0_wi_new*q1_vw_new + q1_wi_new*q0_vw_new - q2_wi_new*q3_vw_new + q3_wi_new*q2_vw_new))*(q0_wi_old*q2_vw_old + q2_wi_old*q0_vw_old + q1_wi_old*q3_vw_old - q3_wi_old*q1_vw_old) + (q0_ic_new*(q0_wi_new*q3_vw_new - q1_wi_new*q2_vw_new + q2_wi_new*q1_vw_new + q3_wi_new*q0_vw_new) - q1_ic_new*(q0_wi_new*q2_vw_new + q2_wi_new*q0_vw_new + q1_wi_new*q3_vw_new - q3_wi_new*q1_vw_new) + q2_ic_new*(q0_wi_new*q1_vw_new + q1_wi_new*q0_vw_new - q2_wi_new*q3_vw_new + q3_wi_new*q2_vw_new) - q3_ic_new*(q1_wi_new*q1_vw_new - q0_wi_new*q0_vw_new + q2_wi_new*q2_vw_new + q3_wi_new*q3_vw_new))*(q0_wi_old*q3_vw_old - q1_wi_old*q2_vw_old + q2_wi_old*q1_vw_old + q3_wi_old*q0_vw_old), (q0_ic_new*(q1_wi_new*q1_vw_new - q0_wi_new*q0_vw_new + q2_wi_new*q2_vw_new + q3_wi_new*q3_vw_new) + q1_ic_new*(q0_wi_new*q1_vw_new + q1_wi_new*q0_vw_new - q2_wi_new*q3_vw_new + q3_wi_new*q2_vw_new) + q2_ic_new*(q0_wi_new*q2_vw_new + q2_wi_new*q0_vw_new + q1_wi_new*q3_vw_new - q3_wi_new*q1_vw_new) + q3_ic_new*(q0_wi_new*q3_vw_new - q1_wi_new*q2_vw_new + q2_wi_new*q1_vw_new + q3_wi_new*q0_vw_new))*(q0_wi_old*q1_vw_old + q1_wi_old*q0_vw_old - q2_wi_old*q3_vw_old + q3_wi_old*q2_vw_old) - (q0_ic_new*(q0_wi_new*q1_vw_new + q1_wi_new*q0_vw_new - q2_wi_new*q3_vw_new + q3_wi_new*q2_vw_new) - q1_ic_new*(q1_wi_new*q1_vw_new - q0_wi_new*q0_vw_new + q2_wi_new*q2_vw_new + q3_wi_new*q3_vw_new) - q2_ic_new*(q0_wi_new*q3_vw_new - q1_wi_new*q2_vw_new + q2_wi_new*q1_vw_new + q3_wi_new*q0_vw_new) + q3_ic_new*(q0_wi_new*q2_vw_new + q2_wi_new*q0_vw_new + q1_wi_new*q3_vw_new - q3_wi_new*q1_vw_new))*(q1_wi_old*q1_vw_old - q0_wi_old*q0_vw_old + q2_wi_old*q2_vw_old + q3_wi_old*q3_vw_old) + (q0_ic_new*(q0_wi_new*q2_vw_new + q2_wi_new*q0_vw_new + q1_wi_new*q3_vw_new - q3_wi_new*q1_vw_new) + q1_ic_new*(q0_wi_new*q3_vw_new - q1_wi_new*q2_vw_new + q2_wi_new*q1_vw_new + q3_wi_new*q0_vw_new) - q2_ic_new*(q1_wi_new*q1_vw_new - q0_wi_new*q0_vw_new + q2_wi_new*q2_vw_new + q3_wi_new*q3_vw_new) - q3_ic_new*(q0_wi_new*q1_vw_new + q1_wi_new*q0_vw_new - q2_wi_new*q3_vw_new + q3_wi_new*q2_vw_new))*(q0_wi_old*q3_vw_old - q1_wi_old*q2_vw_old + q2_wi_old*q1_vw_old + q3_wi_old*q0_vw_old) - (q0_ic_new*(q0_wi_new*q3_vw_new - q1_wi_new*q2_vw_new + q2_wi_new*q1_vw_new + q3_wi_new*q0_vw_new) - q1_ic_new*(q0_wi_new*q2_vw_new + q2_wi_new*q0_vw_new + q1_wi_new*q3_vw_new - q3_wi_new*q1_vw_new) + q2_ic_new*(q0_wi_new*q1_vw_new + q1_wi_new*q0_vw_new - q2_wi_new*q3_vw_new + q3_wi_new*q2_vw_new) - q3_ic_new*(q1_wi_new*q1_vw_new - q0_wi_new*q0_vw_new + q2_wi_new*q2_vw_new + q3_wi_new*q3_vw_new))*(q0_wi_old*q2_vw_old + q2_wi_old*q0_vw_old + q1_wi_old*q3_vw_old - q3_wi_old*q1_vw_old)]
                              [ (q0_ic_new*(q0_wi_new*q2_vw_new + q2_wi_new*q0_vw_new + q1_wi_new*q3_vw_new - q3_wi_new*q1_vw_new) + q1_ic_new*(q0_wi_new*q3_vw_new - q1_wi_new*q2_vw_new + q2_wi_new*q1_vw_new + q3_wi_new*q0_vw_new) - q2_ic_new*(q1_wi_new*q1_vw_new - q0_wi_new*q0_vw_new + q2_wi_new*q2_vw_new + q3_wi_new*q3_vw_new) - q3_ic_new*(q0_wi_new*q1_vw_new + q1_wi_new*q0_vw_new - q2_wi_new*q3_vw_new + q3_wi_new*q2_vw_new))*(q0_wi_old*q1_vw_old + q1_wi_old*q0_vw_old - q2_wi_old*q3_vw_old + q3_wi_old*q2_vw_old) - (q0_ic_new*(q0_wi_new*q1_vw_new + q1_wi_new*q0_vw_new - q2_wi_new*q3_vw_new + q3_wi_new*q2_vw_new) - q1_ic_new*(q1_wi_new*q1_vw_new - q0_wi_new*q0_vw_new + q2_wi_new*q2_vw_new + q3_wi_new*q3_vw_new) - q2_ic_new*(q0_wi_new*q3_vw_new - q1_wi_new*q2_vw_new + q2_wi_new*q1_vw_new + q3_wi_new*q0_vw_new) + q3_ic_new*(q0_wi_new*q2_vw_new + q2_wi_new*q0_vw_new + q1_wi_new*q3_vw_new - q3_wi_new*q1_vw_new))*(q0_wi_old*q2_vw_old + q2_wi_old*q0_vw_old + q1_wi_old*q3_vw_old - q3_wi_old*q1_vw_old) - (q0_ic_new*(q1_wi_new*q1_vw_new - q0_wi_new*q0_vw_new + q2_wi_new*q2_vw_new + q3_wi_new*q3_vw_new) + q1_ic_new*(q0_wi_new*q1_vw_new + q1_wi_new*q0_vw_new - q2_wi_new*q3_vw_new + q3_wi_new*q2_vw_new) + q2_ic_new*(q0_wi_new*q2_vw_new + q2_wi_new*q0_vw_new + q1_wi_new*q3_vw_new - q3_wi_new*q1_vw_new) + q3_ic_new*(q0_wi_new*q3_vw_new - q1_wi_new*q2_vw_new + q2_wi_new*q1_vw_new + q3_wi_new*q0_vw_new))*(q0_wi_old*q3_vw_old - q1_wi_old*q2_vw_old + q2_wi_old*q1_vw_old + q3_wi_old*q0_vw_old) + (q0_ic_new*(q0_wi_new*q3_vw_new - q1_wi_new*q2_vw_new + q2_wi_new*q1_vw_new + q3_wi_new*q0_vw_new) - q1_ic_new*(q0_wi_new*q2_vw_new + q2_wi_new*q0_vw_new + q1_wi_new*q3_vw_new - q3_wi_new*q1_vw_new) + q2_ic_new*(q0_wi_new*q1_vw_new + q1_wi_new*q0_vw_new - q2_wi_new*q3_vw_new + q3_wi_new*q2_vw_new) - q3_ic_new*(q1_wi_new*q1_vw_new - q0_wi_new*q0_vw_new + q2_wi_new*q2_vw_new + q3_wi_new*q3_vw_new))*(q1_wi_old*q1_vw_old - q0_wi_old*q0_vw_old + q2_wi_old*q2_vw_old + q3_wi_old*q3_vw_old), (q0_ic_new*(q1_wi_new*q1_vw_new - q0_wi_new*q0_vw_new + q2_wi_new*q2_vw_new + q3_wi_new*q3_vw_new) + q1_ic_new*(q0_wi_new*q1_vw_new + q1_wi_new*q0_vw_new - q2_wi_new*q3_vw_new + q3_wi_new*q2_vw_new) + q2_ic_new*(q0_wi_new*q2_vw_new + q2_wi_new*q0_vw_new + q1_wi_new*q3_vw_new - q3_wi_new*q1_vw_new) + q3_ic_new*(q0_wi_new*q3_vw_new - q1_wi_new*q2_vw_new + q2_wi_new*q1_vw_new + q3_wi_new*q0_vw_new))*(q0_wi_old*q2_vw_old + q2_wi_old*q0_vw_old + q1_wi_old*q3_vw_old - q3_wi_old*q1_vw_old) - (q0_ic_new*(q0_wi_new*q1_vw_new + q1_wi_new*q0_vw_new - q2_wi_new*q3_vw_new + q3_wi_new*q2_vw_new) - q1_ic_new*(q1_wi_new*q1_vw_new - q0_wi_new*q0_vw_new + q2_wi_new*q2_vw_new + q3_wi_new*q3_vw_new) - q2_ic_new*(q0_wi_new*q3_vw_new - q1_wi_new*q2_vw_new + q2_wi_new*q1_vw_new + q3_wi_new*q0_vw_new) + q3_ic_new*(q0_wi_new*q2_vw_new + q2_wi_new*q0_vw_new + q1_wi_new*q3_vw_new - q3_wi_new*q1_vw_new))*(q0_wi_old*q3_vw_old - q1_wi_old*q2_vw_old + q2_wi_old*q1_vw_old + q3_wi_old*q0_vw_old) - (q0_ic_new*(q0_wi_new*q2_vw_new + q2_wi_new*q0_vw_new + q1_wi_new*q3_vw_new - q3_wi_new*q1_vw_new) + q1_ic_new*(q0_wi_new*q3_vw_new - q1_wi_new*q2_vw_new + q2_wi_new*q1_vw_new + q3_wi_new*q0_vw_new) - q2_ic_new*(q1_wi_new*q1_vw_new - q0_wi_new*q0_vw_new + q2_wi_new*q2_vw_new + q3_wi_new*q3_vw_new) - q3_ic_new*(q0_wi_new*q1_vw_new + q1_wi_new*q0_vw_new - q2_wi_new*q3_vw_new + q3_wi_new*q2_vw_new))*(q1_wi_old*q1_vw_old - q0_wi_old*q0_vw_old + q2_wi_old*q2_vw_old + q3_wi_old*q3_vw_old) + (q0_ic_new*(q0_wi_new*q3_vw_new - q1_wi_new*q2_vw_new + q2_wi_new*q1_vw_new + q3_wi_new*q0_vw_new) - q1_ic_new*(q0_wi_new*q2_vw_new + q2_wi_new*q0_vw_new + q1_wi_new*q3_vw_new - q3_wi_new*q1_vw_new) + q2_ic_new*(q0_wi_new*q1_vw_new + q1_wi_new*q0_vw_new - q2_wi_new*q3_vw_new + q3_wi_new*q2_vw_new) - q3_ic_new*(q1_wi_new*q1_vw_new - q0_wi_new*q0_vw_new + q2_wi_new*q2_vw_new + q3_wi_new*q3_vw_new))*(q0_wi_old*q1_vw_old + q1_wi_old*q0_vw_old - q2_wi_old*q3_vw_old + q3_wi_old*q2_vw_old), (q0_ic_new*(q0_wi_new*q1_vw_new + q1_wi_new*q0_vw_new - q2_wi_new*q3_vw_new + q3_wi_new*q2_vw_new) - q1_ic_new*(q1_wi_new*q1_vw_new - q0_wi_new*q0_vw_new + q2_wi_new*q2_vw_new + q3_wi_new*q3_vw_new) - q2_ic_new*(q0_wi_new*q3_vw_new - q1_wi_new*q2_vw_new + q2_wi_new*q1_vw_new + q3_wi_new*q0_vw_new) + q3_ic_new*(q0_wi_new*q2_vw_new + q2_wi_new*q0_vw_new + q1_wi_new*q3_vw_new - q3_wi_new*q1_vw_new))*(q1_wi_old*q1_vw_old - q0_wi_old*q0_vw_old + q2_wi_old*q2_vw_old + q3_wi_old*q3_vw_old) - (q0_ic_new*(q1_wi_new*q1_vw_new - q0_wi_new*q0_vw_new + q2_wi_new*q2_vw_new + q3_wi_new*q3_vw_new) + q1_ic_new*(q0_wi_new*q1_vw_new + q1_wi_new*q0_vw_new - q2_wi_new*q3_vw_new + q3_wi_new*q2_vw_new) + q2_ic_new*(q0_wi_new*q2_vw_new + q2_wi_new*q0_vw_new + q1_wi_new*q3_vw_new - q3_wi_new*q1_vw_new) + q3_ic_new*(q0_wi_new*q3_vw_new - q1_wi_new*q2_vw_new + q2_wi_new*q1_vw_new + q3_wi_new*q0_vw_new))*(q0_wi_old*q1_vw_old + q1_wi_old*q0_vw_old - q2_wi_old*q3_vw_old + q3_wi_old*q2_vw_old) - (q0_ic_new*(q0_wi_new*q2_vw_new + q2_wi_new*q0_vw_new + q1_wi_new*q3_vw_new - q3_wi_new*q1_vw_new) + q1_ic_new*(q0_wi_new*q3_vw_new - q1_wi_new*q2_vw_new + q2_wi_new*q1_vw_new + q3_wi_new*q0_vw_new) - q2_ic_new*(q1_wi_new*q1_vw_new - q0_wi_new*q0_vw_new + q2_wi_new*q2_vw_new + q3_wi_new*q3_vw_new) - q3_ic_new*(q0_wi_new*q1_vw_new + q1_wi_new*q0_vw_new - q2_wi_new*q3_vw_new + q3_wi_new*q2_vw_new))*(q0_wi_old*q3_vw_old - q1_wi_old*q2_vw_old + q2_wi_old*q1_vw_old + q3_wi_old*q0_vw_old) + (q0_ic_new*(q0_wi_new*q3_vw_new - q1_wi_new*q2_vw_new + q2_wi_new*q1_vw_new + q3_wi_new*q0_vw_new) - q1_ic_new*(q0_wi_new*q2_vw_new + q2_wi_new*q0_vw_new + q1_wi_new*q3_vw_new - q3_wi_new*q1_vw_new) + q2_ic_new*(q0_wi_new*q1_vw_new + q1_wi_new*q0_vw_new - q2_wi_new*q3_vw_new + q3_wi_new*q2_vw_new) - q3_ic_new*(q1_wi_new*q1_vw_new - q0_wi_new*q0_vw_new + q2_wi_new*q2_vw_new + q3_wi_new*q3_vw_new))*(q0_wi_old*q2_vw_old + q2_wi_old*q0_vw_old + q1_wi_old*q3_vw_old - q3_wi_old*q1_vw_old), (q0_ic_new*(q1_wi_new*q1_vw_new - q0_wi_new*q0_vw_new + q2_wi_new*q2_vw_new + q3_wi_new*q3_vw_new) + q1_ic_new*(q0_wi_new*q1_vw_new + q1_wi_new*q0_vw_new - q2_wi_new*q3_vw_new + q3_wi_new*q2_vw_new) + q2_ic_new*(q0_wi_new*q2_vw_new + q2_wi_new*q0_vw_new + q1_wi_new*q3_vw_new - q3_wi_new*q1_vw_new) + q3_ic_new*(q0_wi_new*q3_vw_new - q1_wi_new*q2_vw_new + q2_wi_new*q1_vw_new + q3_wi_new*q0_vw_new))*(q1_wi_old*q1_vw_old - q0_wi_old*q0_vw_old + q2_wi_old*q2_vw_old + q3_wi_old*q3_vw_old) + (q0_ic_new*(q0_wi_new*q1_vw_new + q1_wi_new*q0_vw_new - q2_wi_new*q3_vw_new + q3_wi_new*q2_vw_new) - q1_ic_new*(q1_wi_new*q1_vw_new - q0_wi_new*q0_vw_new + q2_wi_new*q2_vw_new + q3_wi_new*q3_vw_new) - q2_ic_new*(q0_wi_new*q3_vw_new - q1_wi_new*q2_vw_new + q2_wi_new*q1_vw_new + q3_wi_new*q0_vw_new) + q3_ic_new*(q0_wi_new*q2_vw_new + q2_wi_new*q0_vw_new + q1_wi_new*q3_vw_new - q3_wi_new*q1_vw_new))*(q0_wi_old*q1_vw_old + q1_wi_old*q0_vw_old - q2_wi_old*q3_vw_old + q3_wi_old*q2_vw_old) + (q0_ic_new*(q0_wi_new*q2_vw_new + q2_wi_new*q0_vw_new + q1_wi_new*q3_vw_new - q3_wi_new*q1_vw_new) + q1_ic_new*(q0_wi_new*q3_vw_new - q1_wi_new*q2_vw_new + q2_wi_new*q1_vw_new + q3_wi_new*q0_vw_new) - q2_ic_new*(q1_wi_new*q1_vw_new - q0_wi_new*q0_vw_new + q2_wi_new*q2_vw_new + q3_wi_new*q3_vw_new) - q3_ic_new*(q0_wi_new*q1_vw_new + q1_wi_new*q0_vw_new - q2_wi_new*q3_vw_new + q3_wi_new*q2_vw_new))*(q0_wi_old*q2_vw_old + q2_wi_old*q0_vw_old + q1_wi_old*q3_vw_old - q3_wi_old*q1_vw_old) + (q0_ic_new*(q0_wi_new*q3_vw_new - q1_wi_new*q2_vw_new + q2_wi_new*q1_vw_new + q3_wi_new*q0_vw_new) - q1_ic_new*(q0_wi_new*q2_vw_new + q2_wi_new*q0_vw_new + q1_wi_new*q3_vw_new - q3_wi_new*q1_vw_new) + q2_ic_new*(q0_wi_new*q1_vw_new + q1_wi_new*q0_vw_new - q2_wi_new*q3_vw_new + q3_wi_new*q2_vw_new) - q3_ic_new*(q1_wi_new*q1_vw_new - q0_wi_new*q0_vw_new + q2_wi_new*q2_vw_new + q3_wi_new*q3_vw_new))*(q0_wi_old*q3_vw_old - q1_wi_old*q2_vw_old + q2_wi_old*q1_vw_old + q3_wi_old*q0_vw_old)]];
    
elseif (param.fusion.camFixQuatic == 1)
    H_z_q_relative_qic_old = zeros(4,4);
                
end

% qHk(q_vw) = delta(z_q_relative) / delta(q_vw_k)
if (param.fusion.camFixQuatvw == 0)
    H_z_q_relative_qvw_old = [[ (q0_ic_new*(q1_wi_new*q1_vw_new - q0_wi_new*q0_vw_new + q2_wi_new*q2_vw_new + q3_wi_new*q3_vw_new) + q1_ic_new*(q0_wi_new*q1_vw_new + q1_wi_new*q0_vw_new - q2_wi_new*q3_vw_new + q3_wi_new*q2_vw_new) + q2_ic_new*(q0_wi_new*q2_vw_new + q2_wi_new*q0_vw_new + q1_wi_new*q3_vw_new - q3_wi_new*q1_vw_new) + q3_ic_new*(q0_wi_new*q3_vw_new - q1_wi_new*q2_vw_new + q2_wi_new*q1_vw_new + q3_wi_new*q0_vw_new))*(q1_ic_old*q1_wi_old - q0_ic_old*q0_wi_old + q2_ic_old*q2_wi_old + q3_ic_old*q3_wi_old) + (q0_ic_new*(q0_wi_new*q1_vw_new + q1_wi_new*q0_vw_new - q2_wi_new*q3_vw_new + q3_wi_new*q2_vw_new) - q1_ic_new*(q1_wi_new*q1_vw_new - q0_wi_new*q0_vw_new + q2_wi_new*q2_vw_new + q3_wi_new*q3_vw_new) - q2_ic_new*(q0_wi_new*q3_vw_new - q1_wi_new*q2_vw_new + q2_wi_new*q1_vw_new + q3_wi_new*q0_vw_new) + q3_ic_new*(q0_wi_new*q2_vw_new + q2_wi_new*q0_vw_new + q1_wi_new*q3_vw_new - q3_wi_new*q1_vw_new))*(q0_ic_old*q1_wi_old + q1_ic_old*q0_wi_old - q2_ic_old*q3_wi_old + q3_ic_old*q2_wi_old) + (q0_ic_new*(q0_wi_new*q2_vw_new + q2_wi_new*q0_vw_new + q1_wi_new*q3_vw_new - q3_wi_new*q1_vw_new) + q1_ic_new*(q0_wi_new*q3_vw_new - q1_wi_new*q2_vw_new + q2_wi_new*q1_vw_new + q3_wi_new*q0_vw_new) - q2_ic_new*(q1_wi_new*q1_vw_new - q0_wi_new*q0_vw_new + q2_wi_new*q2_vw_new + q3_wi_new*q3_vw_new) - q3_ic_new*(q0_wi_new*q1_vw_new + q1_wi_new*q0_vw_new - q2_wi_new*q3_vw_new + q3_wi_new*q2_vw_new))*(q0_ic_old*q2_wi_old + q2_ic_old*q0_wi_old + q1_ic_old*q3_wi_old - q3_ic_old*q1_wi_old) + (q0_ic_new*(q0_wi_new*q3_vw_new - q1_wi_new*q2_vw_new + q2_wi_new*q1_vw_new + q3_wi_new*q0_vw_new) - q1_ic_new*(q0_wi_new*q2_vw_new + q2_wi_new*q0_vw_new + q1_wi_new*q3_vw_new - q3_wi_new*q1_vw_new) + q2_ic_new*(q0_wi_new*q1_vw_new + q1_wi_new*q0_vw_new - q2_wi_new*q3_vw_new + q3_wi_new*q2_vw_new) - q3_ic_new*(q1_wi_new*q1_vw_new - q0_wi_new*q0_vw_new + q2_wi_new*q2_vw_new + q3_wi_new*q3_vw_new))*(q0_ic_old*q3_wi_old - q1_ic_old*q2_wi_old + q2_ic_old*q1_wi_old + q3_ic_old*q0_wi_old), (q0_ic_new*(q1_wi_new*q1_vw_new - q0_wi_new*q0_vw_new + q2_wi_new*q2_vw_new + q3_wi_new*q3_vw_new) + q1_ic_new*(q0_wi_new*q1_vw_new + q1_wi_new*q0_vw_new - q2_wi_new*q3_vw_new + q3_wi_new*q2_vw_new) + q2_ic_new*(q0_wi_new*q2_vw_new + q2_wi_new*q0_vw_new + q1_wi_new*q3_vw_new - q3_wi_new*q1_vw_new) + q3_ic_new*(q0_wi_new*q3_vw_new - q1_wi_new*q2_vw_new + q2_wi_new*q1_vw_new + q3_wi_new*q0_vw_new))*(q0_ic_old*q1_wi_old + q1_ic_old*q0_wi_old - q2_ic_old*q3_wi_old + q3_ic_old*q2_wi_old) - (q0_ic_new*(q0_wi_new*q1_vw_new + q1_wi_new*q0_vw_new - q2_wi_new*q3_vw_new + q3_wi_new*q2_vw_new) - q1_ic_new*(q1_wi_new*q1_vw_new - q0_wi_new*q0_vw_new + q2_wi_new*q2_vw_new + q3_wi_new*q3_vw_new) - q2_ic_new*(q0_wi_new*q3_vw_new - q1_wi_new*q2_vw_new + q2_wi_new*q1_vw_new + q3_wi_new*q0_vw_new) + q3_ic_new*(q0_wi_new*q2_vw_new + q2_wi_new*q0_vw_new + q1_wi_new*q3_vw_new - q3_wi_new*q1_vw_new))*(q1_ic_old*q1_wi_old - q0_ic_old*q0_wi_old + q2_ic_old*q2_wi_old + q3_ic_old*q3_wi_old) - (q0_ic_new*(q0_wi_new*q2_vw_new + q2_wi_new*q0_vw_new + q1_wi_new*q3_vw_new - q3_wi_new*q1_vw_new) + q1_ic_new*(q0_wi_new*q3_vw_new - q1_wi_new*q2_vw_new + q2_wi_new*q1_vw_new + q3_wi_new*q0_vw_new) - q2_ic_new*(q1_wi_new*q1_vw_new - q0_wi_new*q0_vw_new + q2_wi_new*q2_vw_new + q3_wi_new*q3_vw_new) - q3_ic_new*(q0_wi_new*q1_vw_new + q1_wi_new*q0_vw_new - q2_wi_new*q3_vw_new + q3_wi_new*q2_vw_new))*(q0_ic_old*q3_wi_old - q1_ic_old*q2_wi_old + q2_ic_old*q1_wi_old + q3_ic_old*q0_wi_old) + (q0_ic_new*(q0_wi_new*q3_vw_new - q1_wi_new*q2_vw_new + q2_wi_new*q1_vw_new + q3_wi_new*q0_vw_new) - q1_ic_new*(q0_wi_new*q2_vw_new + q2_wi_new*q0_vw_new + q1_wi_new*q3_vw_new - q3_wi_new*q1_vw_new) + q2_ic_new*(q0_wi_new*q1_vw_new + q1_wi_new*q0_vw_new - q2_wi_new*q3_vw_new + q3_wi_new*q2_vw_new) - q3_ic_new*(q1_wi_new*q1_vw_new - q0_wi_new*q0_vw_new + q2_wi_new*q2_vw_new + q3_wi_new*q3_vw_new))*(q0_ic_old*q2_wi_old + q2_ic_old*q0_wi_old + q1_ic_old*q3_wi_old - q3_ic_old*q1_wi_old), (q0_ic_new*(q1_wi_new*q1_vw_new - q0_wi_new*q0_vw_new + q2_wi_new*q2_vw_new + q3_wi_new*q3_vw_new) + q1_ic_new*(q0_wi_new*q1_vw_new + q1_wi_new*q0_vw_new - q2_wi_new*q3_vw_new + q3_wi_new*q2_vw_new) + q2_ic_new*(q0_wi_new*q2_vw_new + q2_wi_new*q0_vw_new + q1_wi_new*q3_vw_new - q3_wi_new*q1_vw_new) + q3_ic_new*(q0_wi_new*q3_vw_new - q1_wi_new*q2_vw_new + q2_wi_new*q1_vw_new + q3_wi_new*q0_vw_new))*(q0_ic_old*q2_wi_old + q2_ic_old*q0_wi_old + q1_ic_old*q3_wi_old - q3_ic_old*q1_wi_old) + (q0_ic_new*(q0_wi_new*q1_vw_new + q1_wi_new*q0_vw_new - q2_wi_new*q3_vw_new + q3_wi_new*q2_vw_new) - q1_ic_new*(q1_wi_new*q1_vw_new - q0_wi_new*q0_vw_new + q2_wi_new*q2_vw_new + q3_wi_new*q3_vw_new) - q2_ic_new*(q0_wi_new*q3_vw_new - q1_wi_new*q2_vw_new + q2_wi_new*q1_vw_new + q3_wi_new*q0_vw_new) + q3_ic_new*(q0_wi_new*q2_vw_new + q2_wi_new*q0_vw_new + q1_wi_new*q3_vw_new - q3_wi_new*q1_vw_new))*(q0_ic_old*q3_wi_old - q1_ic_old*q2_wi_old + q2_ic_old*q1_wi_old + q3_ic_old*q0_wi_old) - (q0_ic_new*(q0_wi_new*q2_vw_new + q2_wi_new*q0_vw_new + q1_wi_new*q3_vw_new - q3_wi_new*q1_vw_new) + q1_ic_new*(q0_wi_new*q3_vw_new - q1_wi_new*q2_vw_new + q2_wi_new*q1_vw_new + q3_wi_new*q0_vw_new) - q2_ic_new*(q1_wi_new*q1_vw_new - q0_wi_new*q0_vw_new + q2_wi_new*q2_vw_new + q3_wi_new*q3_vw_new) - q3_ic_new*(q0_wi_new*q1_vw_new + q1_wi_new*q0_vw_new - q2_wi_new*q3_vw_new + q3_wi_new*q2_vw_new))*(q1_ic_old*q1_wi_old - q0_ic_old*q0_wi_old + q2_ic_old*q2_wi_old + q3_ic_old*q3_wi_old) - (q0_ic_new*(q0_wi_new*q3_vw_new - q1_wi_new*q2_vw_new + q2_wi_new*q1_vw_new + q3_wi_new*q0_vw_new) - q1_ic_new*(q0_wi_new*q2_vw_new + q2_wi_new*q0_vw_new + q1_wi_new*q3_vw_new - q3_wi_new*q1_vw_new) + q2_ic_new*(q0_wi_new*q1_vw_new + q1_wi_new*q0_vw_new - q2_wi_new*q3_vw_new + q3_wi_new*q2_vw_new) - q3_ic_new*(q1_wi_new*q1_vw_new - q0_wi_new*q0_vw_new + q2_wi_new*q2_vw_new + q3_wi_new*q3_vw_new))*(q0_ic_old*q1_wi_old + q1_ic_old*q0_wi_old - q2_ic_old*q3_wi_old + q3_ic_old*q2_wi_old), (q0_ic_new*(q1_wi_new*q1_vw_new - q0_wi_new*q0_vw_new + q2_wi_new*q2_vw_new + q3_wi_new*q3_vw_new) + q1_ic_new*(q0_wi_new*q1_vw_new + q1_wi_new*q0_vw_new - q2_wi_new*q3_vw_new + q3_wi_new*q2_vw_new) + q2_ic_new*(q0_wi_new*q2_vw_new + q2_wi_new*q0_vw_new + q1_wi_new*q3_vw_new - q3_wi_new*q1_vw_new) + q3_ic_new*(q0_wi_new*q3_vw_new - q1_wi_new*q2_vw_new + q2_wi_new*q1_vw_new + q3_wi_new*q0_vw_new))*(q0_ic_old*q3_wi_old - q1_ic_old*q2_wi_old + q2_ic_old*q1_wi_old + q3_ic_old*q0_wi_old) - (q0_ic_new*(q0_wi_new*q1_vw_new + q1_wi_new*q0_vw_new - q2_wi_new*q3_vw_new + q3_wi_new*q2_vw_new) - q1_ic_new*(q1_wi_new*q1_vw_new - q0_wi_new*q0_vw_new + q2_wi_new*q2_vw_new + q3_wi_new*q3_vw_new) - q2_ic_new*(q0_wi_new*q3_vw_new - q1_wi_new*q2_vw_new + q2_wi_new*q1_vw_new + q3_wi_new*q0_vw_new) + q3_ic_new*(q0_wi_new*q2_vw_new + q2_wi_new*q0_vw_new + q1_wi_new*q3_vw_new - q3_wi_new*q1_vw_new))*(q0_ic_old*q2_wi_old + q2_ic_old*q0_wi_old + q1_ic_old*q3_wi_old - q3_ic_old*q1_wi_old) + (q0_ic_new*(q0_wi_new*q2_vw_new + q2_wi_new*q0_vw_new + q1_wi_new*q3_vw_new - q3_wi_new*q1_vw_new) + q1_ic_new*(q0_wi_new*q3_vw_new - q1_wi_new*q2_vw_new + q2_wi_new*q1_vw_new + q3_wi_new*q0_vw_new) - q2_ic_new*(q1_wi_new*q1_vw_new - q0_wi_new*q0_vw_new + q2_wi_new*q2_vw_new + q3_wi_new*q3_vw_new) - q3_ic_new*(q0_wi_new*q1_vw_new + q1_wi_new*q0_vw_new - q2_wi_new*q3_vw_new + q3_wi_new*q2_vw_new))*(q0_ic_old*q1_wi_old + q1_ic_old*q0_wi_old - q2_ic_old*q3_wi_old + q3_ic_old*q2_wi_old) - (q0_ic_new*(q0_wi_new*q3_vw_new - q1_wi_new*q2_vw_new + q2_wi_new*q1_vw_new + q3_wi_new*q0_vw_new) - q1_ic_new*(q0_wi_new*q2_vw_new + q2_wi_new*q0_vw_new + q1_wi_new*q3_vw_new - q3_wi_new*q1_vw_new) + q2_ic_new*(q0_wi_new*q1_vw_new + q1_wi_new*q0_vw_new - q2_wi_new*q3_vw_new + q3_wi_new*q2_vw_new) - q3_ic_new*(q1_wi_new*q1_vw_new - q0_wi_new*q0_vw_new + q2_wi_new*q2_vw_new + q3_wi_new*q3_vw_new))*(q1_ic_old*q1_wi_old - q0_ic_old*q0_wi_old + q2_ic_old*q2_wi_old + q3_ic_old*q3_wi_old)]
                              [ (q0_ic_new*(q0_wi_new*q1_vw_new + q1_wi_new*q0_vw_new - q2_wi_new*q3_vw_new + q3_wi_new*q2_vw_new) - q1_ic_new*(q1_wi_new*q1_vw_new - q0_wi_new*q0_vw_new + q2_wi_new*q2_vw_new + q3_wi_new*q3_vw_new) - q2_ic_new*(q0_wi_new*q3_vw_new - q1_wi_new*q2_vw_new + q2_wi_new*q1_vw_new + q3_wi_new*q0_vw_new) + q3_ic_new*(q0_wi_new*q2_vw_new + q2_wi_new*q0_vw_new + q1_wi_new*q3_vw_new - q3_wi_new*q1_vw_new))*(q1_ic_old*q1_wi_old - q0_ic_old*q0_wi_old + q2_ic_old*q2_wi_old + q3_ic_old*q3_wi_old) - (q0_ic_new*(q1_wi_new*q1_vw_new - q0_wi_new*q0_vw_new + q2_wi_new*q2_vw_new + q3_wi_new*q3_vw_new) + q1_ic_new*(q0_wi_new*q1_vw_new + q1_wi_new*q0_vw_new - q2_wi_new*q3_vw_new + q3_wi_new*q2_vw_new) + q2_ic_new*(q0_wi_new*q2_vw_new + q2_wi_new*q0_vw_new + q1_wi_new*q3_vw_new - q3_wi_new*q1_vw_new) + q3_ic_new*(q0_wi_new*q3_vw_new - q1_wi_new*q2_vw_new + q2_wi_new*q1_vw_new + q3_wi_new*q0_vw_new))*(q0_ic_old*q1_wi_old + q1_ic_old*q0_wi_old - q2_ic_old*q3_wi_old + q3_ic_old*q2_wi_old) - (q0_ic_new*(q0_wi_new*q2_vw_new + q2_wi_new*q0_vw_new + q1_wi_new*q3_vw_new - q3_wi_new*q1_vw_new) + q1_ic_new*(q0_wi_new*q3_vw_new - q1_wi_new*q2_vw_new + q2_wi_new*q1_vw_new + q3_wi_new*q0_vw_new) - q2_ic_new*(q1_wi_new*q1_vw_new - q0_wi_new*q0_vw_new + q2_wi_new*q2_vw_new + q3_wi_new*q3_vw_new) - q3_ic_new*(q0_wi_new*q1_vw_new + q1_wi_new*q0_vw_new - q2_wi_new*q3_vw_new + q3_wi_new*q2_vw_new))*(q0_ic_old*q3_wi_old - q1_ic_old*q2_wi_old + q2_ic_old*q1_wi_old + q3_ic_old*q0_wi_old) + (q0_ic_new*(q0_wi_new*q3_vw_new - q1_wi_new*q2_vw_new + q2_wi_new*q1_vw_new + q3_wi_new*q0_vw_new) - q1_ic_new*(q0_wi_new*q2_vw_new + q2_wi_new*q0_vw_new + q1_wi_new*q3_vw_new - q3_wi_new*q1_vw_new) + q2_ic_new*(q0_wi_new*q1_vw_new + q1_wi_new*q0_vw_new - q2_wi_new*q3_vw_new + q3_wi_new*q2_vw_new) - q3_ic_new*(q1_wi_new*q1_vw_new - q0_wi_new*q0_vw_new + q2_wi_new*q2_vw_new + q3_wi_new*q3_vw_new))*(q0_ic_old*q2_wi_old + q2_ic_old*q0_wi_old + q1_ic_old*q3_wi_old - q3_ic_old*q1_wi_old), (q0_ic_new*(q1_wi_new*q1_vw_new - q0_wi_new*q0_vw_new + q2_wi_new*q2_vw_new + q3_wi_new*q3_vw_new) + q1_ic_new*(q0_wi_new*q1_vw_new + q1_wi_new*q0_vw_new - q2_wi_new*q3_vw_new + q3_wi_new*q2_vw_new) + q2_ic_new*(q0_wi_new*q2_vw_new + q2_wi_new*q0_vw_new + q1_wi_new*q3_vw_new - q3_wi_new*q1_vw_new) + q3_ic_new*(q0_wi_new*q3_vw_new - q1_wi_new*q2_vw_new + q2_wi_new*q1_vw_new + q3_wi_new*q0_vw_new))*(q1_ic_old*q1_wi_old - q0_ic_old*q0_wi_old + q2_ic_old*q2_wi_old + q3_ic_old*q3_wi_old) + (q0_ic_new*(q0_wi_new*q1_vw_new + q1_wi_new*q0_vw_new - q2_wi_new*q3_vw_new + q3_wi_new*q2_vw_new) - q1_ic_new*(q1_wi_new*q1_vw_new - q0_wi_new*q0_vw_new + q2_wi_new*q2_vw_new + q3_wi_new*q3_vw_new) - q2_ic_new*(q0_wi_new*q3_vw_new - q1_wi_new*q2_vw_new + q2_wi_new*q1_vw_new + q3_wi_new*q0_vw_new) + q3_ic_new*(q0_wi_new*q2_vw_new + q2_wi_new*q0_vw_new + q1_wi_new*q3_vw_new - q3_wi_new*q1_vw_new))*(q0_ic_old*q1_wi_old + q1_ic_old*q0_wi_old - q2_ic_old*q3_wi_old + q3_ic_old*q2_wi_old) - (q0_ic_new*(q0_wi_new*q2_vw_new + q2_wi_new*q0_vw_new + q1_wi_new*q3_vw_new - q3_wi_new*q1_vw_new) + q1_ic_new*(q0_wi_new*q3_vw_new - q1_wi_new*q2_vw_new + q2_wi_new*q1_vw_new + q3_wi_new*q0_vw_new) - q2_ic_new*(q1_wi_new*q1_vw_new - q0_wi_new*q0_vw_new + q2_wi_new*q2_vw_new + q3_wi_new*q3_vw_new) - q3_ic_new*(q0_wi_new*q1_vw_new + q1_wi_new*q0_vw_new - q2_wi_new*q3_vw_new + q3_wi_new*q2_vw_new))*(q0_ic_old*q2_wi_old + q2_ic_old*q0_wi_old + q1_ic_old*q3_wi_old - q3_ic_old*q1_wi_old) - (q0_ic_new*(q0_wi_new*q3_vw_new - q1_wi_new*q2_vw_new + q2_wi_new*q1_vw_new + q3_wi_new*q0_vw_new) - q1_ic_new*(q0_wi_new*q2_vw_new + q2_wi_new*q0_vw_new + q1_wi_new*q3_vw_new - q3_wi_new*q1_vw_new) + q2_ic_new*(q0_wi_new*q1_vw_new + q1_wi_new*q0_vw_new - q2_wi_new*q3_vw_new + q3_wi_new*q2_vw_new) - q3_ic_new*(q1_wi_new*q1_vw_new - q0_wi_new*q0_vw_new + q2_wi_new*q2_vw_new + q3_wi_new*q3_vw_new))*(q0_ic_old*q3_wi_old - q1_ic_old*q2_wi_old + q2_ic_old*q1_wi_old + q3_ic_old*q0_wi_old), (q0_ic_new*(q0_wi_new*q1_vw_new + q1_wi_new*q0_vw_new - q2_wi_new*q3_vw_new + q3_wi_new*q2_vw_new) - q1_ic_new*(q1_wi_new*q1_vw_new - q0_wi_new*q0_vw_new + q2_wi_new*q2_vw_new + q3_wi_new*q3_vw_new) - q2_ic_new*(q0_wi_new*q3_vw_new - q1_wi_new*q2_vw_new + q2_wi_new*q1_vw_new + q3_wi_new*q0_vw_new) + q3_ic_new*(q0_wi_new*q2_vw_new + q2_wi_new*q0_vw_new + q1_wi_new*q3_vw_new - q3_wi_new*q1_vw_new))*(q0_ic_old*q2_wi_old + q2_ic_old*q0_wi_old + q1_ic_old*q3_wi_old - q3_ic_old*q1_wi_old) - (q0_ic_new*(q1_wi_new*q1_vw_new - q0_wi_new*q0_vw_new + q2_wi_new*q2_vw_new + q3_wi_new*q3_vw_new) + q1_ic_new*(q0_wi_new*q1_vw_new + q1_wi_new*q0_vw_new - q2_wi_new*q3_vw_new + q3_wi_new*q2_vw_new) + q2_ic_new*(q0_wi_new*q2_vw_new + q2_wi_new*q0_vw_new + q1_wi_new*q3_vw_new - q3_wi_new*q1_vw_new) + q3_ic_new*(q0_wi_new*q3_vw_new - q1_wi_new*q2_vw_new + q2_wi_new*q1_vw_new + q3_wi_new*q0_vw_new))*(q0_ic_old*q3_wi_old - q1_ic_old*q2_wi_old + q2_ic_old*q1_wi_old + q3_ic_old*q0_wi_old) + (q0_ic_new*(q0_wi_new*q2_vw_new + q2_wi_new*q0_vw_new + q1_wi_new*q3_vw_new - q3_wi_new*q1_vw_new) + q1_ic_new*(q0_wi_new*q3_vw_new - q1_wi_new*q2_vw_new + q2_wi_new*q1_vw_new + q3_wi_new*q0_vw_new) - q2_ic_new*(q1_wi_new*q1_vw_new - q0_wi_new*q0_vw_new + q2_wi_new*q2_vw_new + q3_wi_new*q3_vw_new) - q3_ic_new*(q0_wi_new*q1_vw_new + q1_wi_new*q0_vw_new - q2_wi_new*q3_vw_new + q3_wi_new*q2_vw_new))*(q0_ic_old*q1_wi_old + q1_ic_old*q0_wi_old - q2_ic_old*q3_wi_old + q3_ic_old*q2_wi_old) - (q0_ic_new*(q0_wi_new*q3_vw_new - q1_wi_new*q2_vw_new + q2_wi_new*q1_vw_new + q3_wi_new*q0_vw_new) - q1_ic_new*(q0_wi_new*q2_vw_new + q2_wi_new*q0_vw_new + q1_wi_new*q3_vw_new - q3_wi_new*q1_vw_new) + q2_ic_new*(q0_wi_new*q1_vw_new + q1_wi_new*q0_vw_new - q2_wi_new*q3_vw_new + q3_wi_new*q2_vw_new) - q3_ic_new*(q1_wi_new*q1_vw_new - q0_wi_new*q0_vw_new + q2_wi_new*q2_vw_new + q3_wi_new*q3_vw_new))*(q1_ic_old*q1_wi_old - q0_ic_old*q0_wi_old + q2_ic_old*q2_wi_old + q3_ic_old*q3_wi_old), (q0_ic_new*(q1_wi_new*q1_vw_new - q0_wi_new*q0_vw_new + q2_wi_new*q2_vw_new + q3_wi_new*q3_vw_new) + q1_ic_new*(q0_wi_new*q1_vw_new + q1_wi_new*q0_vw_new - q2_wi_new*q3_vw_new + q3_wi_new*q2_vw_new) + q2_ic_new*(q0_wi_new*q2_vw_new + q2_wi_new*q0_vw_new + q1_wi_new*q3_vw_new - q3_wi_new*q1_vw_new) + q3_ic_new*(q0_wi_new*q3_vw_new - q1_wi_new*q2_vw_new + q2_wi_new*q1_vw_new + q3_wi_new*q0_vw_new))*(q0_ic_old*q2_wi_old + q2_ic_old*q0_wi_old + q1_ic_old*q3_wi_old - q3_ic_old*q1_wi_old) + (q0_ic_new*(q0_wi_new*q1_vw_new + q1_wi_new*q0_vw_new - q2_wi_new*q3_vw_new + q3_wi_new*q2_vw_new) - q1_ic_new*(q1_wi_new*q1_vw_new - q0_wi_new*q0_vw_new + q2_wi_new*q2_vw_new + q3_wi_new*q3_vw_new) - q2_ic_new*(q0_wi_new*q3_vw_new - q1_wi_new*q2_vw_new + q2_wi_new*q1_vw_new + q3_wi_new*q0_vw_new) + q3_ic_new*(q0_wi_new*q2_vw_new + q2_wi_new*q0_vw_new + q1_wi_new*q3_vw_new - q3_wi_new*q1_vw_new))*(q0_ic_old*q3_wi_old - q1_ic_old*q2_wi_old + q2_ic_old*q1_wi_old + q3_ic_old*q0_wi_old) + (q0_ic_new*(q0_wi_new*q2_vw_new + q2_wi_new*q0_vw_new + q1_wi_new*q3_vw_new - q3_wi_new*q1_vw_new) + q1_ic_new*(q0_wi_new*q3_vw_new - q1_wi_new*q2_vw_new + q2_wi_new*q1_vw_new + q3_wi_new*q0_vw_new) - q2_ic_new*(q1_wi_new*q1_vw_new - q0_wi_new*q0_vw_new + q2_wi_new*q2_vw_new + q3_wi_new*q3_vw_new) - q3_ic_new*(q0_wi_new*q1_vw_new + q1_wi_new*q0_vw_new - q2_wi_new*q3_vw_new + q3_wi_new*q2_vw_new))*(q1_ic_old*q1_wi_old - q0_ic_old*q0_wi_old + q2_ic_old*q2_wi_old + q3_ic_old*q3_wi_old) + (q0_ic_new*(q0_wi_new*q3_vw_new - q1_wi_new*q2_vw_new + q2_wi_new*q1_vw_new + q3_wi_new*q0_vw_new) - q1_ic_new*(q0_wi_new*q2_vw_new + q2_wi_new*q0_vw_new + q1_wi_new*q3_vw_new - q3_wi_new*q1_vw_new) + q2_ic_new*(q0_wi_new*q1_vw_new + q1_wi_new*q0_vw_new - q2_wi_new*q3_vw_new + q3_wi_new*q2_vw_new) - q3_ic_new*(q1_wi_new*q1_vw_new - q0_wi_new*q0_vw_new + q2_wi_new*q2_vw_new + q3_wi_new*q3_vw_new))*(q0_ic_old*q1_wi_old + q1_ic_old*q0_wi_old - q2_ic_old*q3_wi_old + q3_ic_old*q2_wi_old)]
                              [ (q0_ic_new*(q0_wi_new*q1_vw_new + q1_wi_new*q0_vw_new - q2_wi_new*q3_vw_new + q3_wi_new*q2_vw_new) - q1_ic_new*(q1_wi_new*q1_vw_new - q0_wi_new*q0_vw_new + q2_wi_new*q2_vw_new + q3_wi_new*q3_vw_new) - q2_ic_new*(q0_wi_new*q3_vw_new - q1_wi_new*q2_vw_new + q2_wi_new*q1_vw_new + q3_wi_new*q0_vw_new) + q3_ic_new*(q0_wi_new*q2_vw_new + q2_wi_new*q0_vw_new + q1_wi_new*q3_vw_new - q3_wi_new*q1_vw_new))*(q0_ic_old*q3_wi_old - q1_ic_old*q2_wi_old + q2_ic_old*q1_wi_old + q3_ic_old*q0_wi_old) - (q0_ic_new*(q1_wi_new*q1_vw_new - q0_wi_new*q0_vw_new + q2_wi_new*q2_vw_new + q3_wi_new*q3_vw_new) + q1_ic_new*(q0_wi_new*q1_vw_new + q1_wi_new*q0_vw_new - q2_wi_new*q3_vw_new + q3_wi_new*q2_vw_new) + q2_ic_new*(q0_wi_new*q2_vw_new + q2_wi_new*q0_vw_new + q1_wi_new*q3_vw_new - q3_wi_new*q1_vw_new) + q3_ic_new*(q0_wi_new*q3_vw_new - q1_wi_new*q2_vw_new + q2_wi_new*q1_vw_new + q3_wi_new*q0_vw_new))*(q0_ic_old*q2_wi_old + q2_ic_old*q0_wi_old + q1_ic_old*q3_wi_old - q3_ic_old*q1_wi_old) + (q0_ic_new*(q0_wi_new*q2_vw_new + q2_wi_new*q0_vw_new + q1_wi_new*q3_vw_new - q3_wi_new*q1_vw_new) + q1_ic_new*(q0_wi_new*q3_vw_new - q1_wi_new*q2_vw_new + q2_wi_new*q1_vw_new + q3_wi_new*q0_vw_new) - q2_ic_new*(q1_wi_new*q1_vw_new - q0_wi_new*q0_vw_new + q2_wi_new*q2_vw_new + q3_wi_new*q3_vw_new) - q3_ic_new*(q0_wi_new*q1_vw_new + q1_wi_new*q0_vw_new - q2_wi_new*q3_vw_new + q3_wi_new*q2_vw_new))*(q1_ic_old*q1_wi_old - q0_ic_old*q0_wi_old + q2_ic_old*q2_wi_old + q3_ic_old*q3_wi_old) - (q0_ic_new*(q0_wi_new*q3_vw_new - q1_wi_new*q2_vw_new + q2_wi_new*q1_vw_new + q3_wi_new*q0_vw_new) - q1_ic_new*(q0_wi_new*q2_vw_new + q2_wi_new*q0_vw_new + q1_wi_new*q3_vw_new - q3_wi_new*q1_vw_new) + q2_ic_new*(q0_wi_new*q1_vw_new + q1_wi_new*q0_vw_new - q2_wi_new*q3_vw_new + q3_wi_new*q2_vw_new) - q3_ic_new*(q1_wi_new*q1_vw_new - q0_wi_new*q0_vw_new + q2_wi_new*q2_vw_new + q3_wi_new*q3_vw_new))*(q0_ic_old*q1_wi_old + q1_ic_old*q0_wi_old - q2_ic_old*q3_wi_old + q3_ic_old*q2_wi_old), (q0_ic_new*(q1_wi_new*q1_vw_new - q0_wi_new*q0_vw_new + q2_wi_new*q2_vw_new + q3_wi_new*q3_vw_new) + q1_ic_new*(q0_wi_new*q1_vw_new + q1_wi_new*q0_vw_new - q2_wi_new*q3_vw_new + q3_wi_new*q2_vw_new) + q2_ic_new*(q0_wi_new*q2_vw_new + q2_wi_new*q0_vw_new + q1_wi_new*q3_vw_new - q3_wi_new*q1_vw_new) + q3_ic_new*(q0_wi_new*q3_vw_new - q1_wi_new*q2_vw_new + q2_wi_new*q1_vw_new + q3_wi_new*q0_vw_new))*(q0_ic_old*q3_wi_old - q1_ic_old*q2_wi_old + q2_ic_old*q1_wi_old + q3_ic_old*q0_wi_old) + (q0_ic_new*(q0_wi_new*q1_vw_new + q1_wi_new*q0_vw_new - q2_wi_new*q3_vw_new + q3_wi_new*q2_vw_new) - q1_ic_new*(q1_wi_new*q1_vw_new - q0_wi_new*q0_vw_new + q2_wi_new*q2_vw_new + q3_wi_new*q3_vw_new) - q2_ic_new*(q0_wi_new*q3_vw_new - q1_wi_new*q2_vw_new + q2_wi_new*q1_vw_new + q3_wi_new*q0_vw_new) + q3_ic_new*(q0_wi_new*q2_vw_new + q2_wi_new*q0_vw_new + q1_wi_new*q3_vw_new - q3_wi_new*q1_vw_new))*(q0_ic_old*q2_wi_old + q2_ic_old*q0_wi_old + q1_ic_old*q3_wi_old - q3_ic_old*q1_wi_old) + (q0_ic_new*(q0_wi_new*q2_vw_new + q2_wi_new*q0_vw_new + q1_wi_new*q3_vw_new - q3_wi_new*q1_vw_new) + q1_ic_new*(q0_wi_new*q3_vw_new - q1_wi_new*q2_vw_new + q2_wi_new*q1_vw_new + q3_wi_new*q0_vw_new) - q2_ic_new*(q1_wi_new*q1_vw_new - q0_wi_new*q0_vw_new + q2_wi_new*q2_vw_new + q3_wi_new*q3_vw_new) - q3_ic_new*(q0_wi_new*q1_vw_new + q1_wi_new*q0_vw_new - q2_wi_new*q3_vw_new + q3_wi_new*q2_vw_new))*(q0_ic_old*q1_wi_old + q1_ic_old*q0_wi_old - q2_ic_old*q3_wi_old + q3_ic_old*q2_wi_old) + (q0_ic_new*(q0_wi_new*q3_vw_new - q1_wi_new*q2_vw_new + q2_wi_new*q1_vw_new + q3_wi_new*q0_vw_new) - q1_ic_new*(q0_wi_new*q2_vw_new + q2_wi_new*q0_vw_new + q1_wi_new*q3_vw_new - q3_wi_new*q1_vw_new) + q2_ic_new*(q0_wi_new*q1_vw_new + q1_wi_new*q0_vw_new - q2_wi_new*q3_vw_new + q3_wi_new*q2_vw_new) - q3_ic_new*(q1_wi_new*q1_vw_new - q0_wi_new*q0_vw_new + q2_wi_new*q2_vw_new + q3_wi_new*q3_vw_new))*(q1_ic_old*q1_wi_old - q0_ic_old*q0_wi_old + q2_ic_old*q2_wi_old + q3_ic_old*q3_wi_old), (q0_ic_new*(q1_wi_new*q1_vw_new - q0_wi_new*q0_vw_new + q2_wi_new*q2_vw_new + q3_wi_new*q3_vw_new) + q1_ic_new*(q0_wi_new*q1_vw_new + q1_wi_new*q0_vw_new - q2_wi_new*q3_vw_new + q3_wi_new*q2_vw_new) + q2_ic_new*(q0_wi_new*q2_vw_new + q2_wi_new*q0_vw_new + q1_wi_new*q3_vw_new - q3_wi_new*q1_vw_new) + q3_ic_new*(q0_wi_new*q3_vw_new - q1_wi_new*q2_vw_new + q2_wi_new*q1_vw_new + q3_wi_new*q0_vw_new))*(q1_ic_old*q1_wi_old - q0_ic_old*q0_wi_old + q2_ic_old*q2_wi_old + q3_ic_old*q3_wi_old) - (q0_ic_new*(q0_wi_new*q1_vw_new + q1_wi_new*q0_vw_new - q2_wi_new*q3_vw_new + q3_wi_new*q2_vw_new) - q1_ic_new*(q1_wi_new*q1_vw_new - q0_wi_new*q0_vw_new + q2_wi_new*q2_vw_new + q3_wi_new*q3_vw_new) - q2_ic_new*(q0_wi_new*q3_vw_new - q1_wi_new*q2_vw_new + q2_wi_new*q1_vw_new + q3_wi_new*q0_vw_new) + q3_ic_new*(q0_wi_new*q2_vw_new + q2_wi_new*q0_vw_new + q1_wi_new*q3_vw_new - q3_wi_new*q1_vw_new))*(q0_ic_old*q1_wi_old + q1_ic_old*q0_wi_old - q2_ic_old*q3_wi_old + q3_ic_old*q2_wi_old) + (q0_ic_new*(q0_wi_new*q2_vw_new + q2_wi_new*q0_vw_new + q1_wi_new*q3_vw_new - q3_wi_new*q1_vw_new) + q1_ic_new*(q0_wi_new*q3_vw_new - q1_wi_new*q2_vw_new + q2_wi_new*q1_vw_new + q3_wi_new*q0_vw_new) - q2_ic_new*(q1_wi_new*q1_vw_new - q0_wi_new*q0_vw_new + q2_wi_new*q2_vw_new + q3_wi_new*q3_vw_new) - q3_ic_new*(q0_wi_new*q1_vw_new + q1_wi_new*q0_vw_new - q2_wi_new*q3_vw_new + q3_wi_new*q2_vw_new))*(q0_ic_old*q2_wi_old + q2_ic_old*q0_wi_old + q1_ic_old*q3_wi_old - q3_ic_old*q1_wi_old) - (q0_ic_new*(q0_wi_new*q3_vw_new - q1_wi_new*q2_vw_new + q2_wi_new*q1_vw_new + q3_wi_new*q0_vw_new) - q1_ic_new*(q0_wi_new*q2_vw_new + q2_wi_new*q0_vw_new + q1_wi_new*q3_vw_new - q3_wi_new*q1_vw_new) + q2_ic_new*(q0_wi_new*q1_vw_new + q1_wi_new*q0_vw_new - q2_wi_new*q3_vw_new + q3_wi_new*q2_vw_new) - q3_ic_new*(q1_wi_new*q1_vw_new - q0_wi_new*q0_vw_new + q2_wi_new*q2_vw_new + q3_wi_new*q3_vw_new))*(q0_ic_old*q3_wi_old - q1_ic_old*q2_wi_old + q2_ic_old*q1_wi_old + q3_ic_old*q0_wi_old), (q0_ic_new*(q0_wi_new*q2_vw_new + q2_wi_new*q0_vw_new + q1_wi_new*q3_vw_new - q3_wi_new*q1_vw_new) + q1_ic_new*(q0_wi_new*q3_vw_new - q1_wi_new*q2_vw_new + q2_wi_new*q1_vw_new + q3_wi_new*q0_vw_new) - q2_ic_new*(q1_wi_new*q1_vw_new - q0_wi_new*q0_vw_new + q2_wi_new*q2_vw_new + q3_wi_new*q3_vw_new) - q3_ic_new*(q0_wi_new*q1_vw_new + q1_wi_new*q0_vw_new - q2_wi_new*q3_vw_new + q3_wi_new*q2_vw_new))*(q0_ic_old*q3_wi_old - q1_ic_old*q2_wi_old + q2_ic_old*q1_wi_old + q3_ic_old*q0_wi_old) - (q0_ic_new*(q0_wi_new*q1_vw_new + q1_wi_new*q0_vw_new - q2_wi_new*q3_vw_new + q3_wi_new*q2_vw_new) - q1_ic_new*(q1_wi_new*q1_vw_new - q0_wi_new*q0_vw_new + q2_wi_new*q2_vw_new + q3_wi_new*q3_vw_new) - q2_ic_new*(q0_wi_new*q3_vw_new - q1_wi_new*q2_vw_new + q2_wi_new*q1_vw_new + q3_wi_new*q0_vw_new) + q3_ic_new*(q0_wi_new*q2_vw_new + q2_wi_new*q0_vw_new + q1_wi_new*q3_vw_new - q3_wi_new*q1_vw_new))*(q1_ic_old*q1_wi_old - q0_ic_old*q0_wi_old + q2_ic_old*q2_wi_old + q3_ic_old*q3_wi_old) - (q0_ic_new*(q1_wi_new*q1_vw_new - q0_wi_new*q0_vw_new + q2_wi_new*q2_vw_new + q3_wi_new*q3_vw_new) + q1_ic_new*(q0_wi_new*q1_vw_new + q1_wi_new*q0_vw_new - q2_wi_new*q3_vw_new + q3_wi_new*q2_vw_new) + q2_ic_new*(q0_wi_new*q2_vw_new + q2_wi_new*q0_vw_new + q1_wi_new*q3_vw_new - q3_wi_new*q1_vw_new) + q3_ic_new*(q0_wi_new*q3_vw_new - q1_wi_new*q2_vw_new + q2_wi_new*q1_vw_new + q3_wi_new*q0_vw_new))*(q0_ic_old*q1_wi_old + q1_ic_old*q0_wi_old - q2_ic_old*q3_wi_old + q3_ic_old*q2_wi_old) + (q0_ic_new*(q0_wi_new*q3_vw_new - q1_wi_new*q2_vw_new + q2_wi_new*q1_vw_new + q3_wi_new*q0_vw_new) - q1_ic_new*(q0_wi_new*q2_vw_new + q2_wi_new*q0_vw_new + q1_wi_new*q3_vw_new - q3_wi_new*q1_vw_new) + q2_ic_new*(q0_wi_new*q1_vw_new + q1_wi_new*q0_vw_new - q2_wi_new*q3_vw_new + q3_wi_new*q2_vw_new) - q3_ic_new*(q1_wi_new*q1_vw_new - q0_wi_new*q0_vw_new + q2_wi_new*q2_vw_new + q3_wi_new*q3_vw_new))*(q0_ic_old*q2_wi_old + q2_ic_old*q0_wi_old + q1_ic_old*q3_wi_old - q3_ic_old*q1_wi_old)]
                              [ (q0_ic_new*(q0_wi_new*q2_vw_new + q2_wi_new*q0_vw_new + q1_wi_new*q3_vw_new - q3_wi_new*q1_vw_new) + q1_ic_new*(q0_wi_new*q3_vw_new - q1_wi_new*q2_vw_new + q2_wi_new*q1_vw_new + q3_wi_new*q0_vw_new) - q2_ic_new*(q1_wi_new*q1_vw_new - q0_wi_new*q0_vw_new + q2_wi_new*q2_vw_new + q3_wi_new*q3_vw_new) - q3_ic_new*(q0_wi_new*q1_vw_new + q1_wi_new*q0_vw_new - q2_wi_new*q3_vw_new + q3_wi_new*q2_vw_new))*(q0_ic_old*q1_wi_old + q1_ic_old*q0_wi_old - q2_ic_old*q3_wi_old + q3_ic_old*q2_wi_old) - (q0_ic_new*(q0_wi_new*q1_vw_new + q1_wi_new*q0_vw_new - q2_wi_new*q3_vw_new + q3_wi_new*q2_vw_new) - q1_ic_new*(q1_wi_new*q1_vw_new - q0_wi_new*q0_vw_new + q2_wi_new*q2_vw_new + q3_wi_new*q3_vw_new) - q2_ic_new*(q0_wi_new*q3_vw_new - q1_wi_new*q2_vw_new + q2_wi_new*q1_vw_new + q3_wi_new*q0_vw_new) + q3_ic_new*(q0_wi_new*q2_vw_new + q2_wi_new*q0_vw_new + q1_wi_new*q3_vw_new - q3_wi_new*q1_vw_new))*(q0_ic_old*q2_wi_old + q2_ic_old*q0_wi_old + q1_ic_old*q3_wi_old - q3_ic_old*q1_wi_old) - (q0_ic_new*(q1_wi_new*q1_vw_new - q0_wi_new*q0_vw_new + q2_wi_new*q2_vw_new + q3_wi_new*q3_vw_new) + q1_ic_new*(q0_wi_new*q1_vw_new + q1_wi_new*q0_vw_new - q2_wi_new*q3_vw_new + q3_wi_new*q2_vw_new) + q2_ic_new*(q0_wi_new*q2_vw_new + q2_wi_new*q0_vw_new + q1_wi_new*q3_vw_new - q3_wi_new*q1_vw_new) + q3_ic_new*(q0_wi_new*q3_vw_new - q1_wi_new*q2_vw_new + q2_wi_new*q1_vw_new + q3_wi_new*q0_vw_new))*(q0_ic_old*q3_wi_old - q1_ic_old*q2_wi_old + q2_ic_old*q1_wi_old + q3_ic_old*q0_wi_old) + (q0_ic_new*(q0_wi_new*q3_vw_new - q1_wi_new*q2_vw_new + q2_wi_new*q1_vw_new + q3_wi_new*q0_vw_new) - q1_ic_new*(q0_wi_new*q2_vw_new + q2_wi_new*q0_vw_new + q1_wi_new*q3_vw_new - q3_wi_new*q1_vw_new) + q2_ic_new*(q0_wi_new*q1_vw_new + q1_wi_new*q0_vw_new - q2_wi_new*q3_vw_new + q3_wi_new*q2_vw_new) - q3_ic_new*(q1_wi_new*q1_vw_new - q0_wi_new*q0_vw_new + q2_wi_new*q2_vw_new + q3_wi_new*q3_vw_new))*(q1_ic_old*q1_wi_old - q0_ic_old*q0_wi_old + q2_ic_old*q2_wi_old + q3_ic_old*q3_wi_old), (q0_ic_new*(q0_wi_new*q1_vw_new + q1_wi_new*q0_vw_new - q2_wi_new*q3_vw_new + q3_wi_new*q2_vw_new) - q1_ic_new*(q1_wi_new*q1_vw_new - q0_wi_new*q0_vw_new + q2_wi_new*q2_vw_new + q3_wi_new*q3_vw_new) - q2_ic_new*(q0_wi_new*q3_vw_new - q1_wi_new*q2_vw_new + q2_wi_new*q1_vw_new + q3_wi_new*q0_vw_new) + q3_ic_new*(q0_wi_new*q2_vw_new + q2_wi_new*q0_vw_new + q1_wi_new*q3_vw_new - q3_wi_new*q1_vw_new))*(q0_ic_old*q3_wi_old - q1_ic_old*q2_wi_old + q2_ic_old*q1_wi_old + q3_ic_old*q0_wi_old) - (q0_ic_new*(q1_wi_new*q1_vw_new - q0_wi_new*q0_vw_new + q2_wi_new*q2_vw_new + q3_wi_new*q3_vw_new) + q1_ic_new*(q0_wi_new*q1_vw_new + q1_wi_new*q0_vw_new - q2_wi_new*q3_vw_new + q3_wi_new*q2_vw_new) + q2_ic_new*(q0_wi_new*q2_vw_new + q2_wi_new*q0_vw_new + q1_wi_new*q3_vw_new - q3_wi_new*q1_vw_new) + q3_ic_new*(q0_wi_new*q3_vw_new - q1_wi_new*q2_vw_new + q2_wi_new*q1_vw_new + q3_wi_new*q0_vw_new))*(q0_ic_old*q2_wi_old + q2_ic_old*q0_wi_old + q1_ic_old*q3_wi_old - q3_ic_old*q1_wi_old) - (q0_ic_new*(q0_wi_new*q2_vw_new + q2_wi_new*q0_vw_new + q1_wi_new*q3_vw_new - q3_wi_new*q1_vw_new) + q1_ic_new*(q0_wi_new*q3_vw_new - q1_wi_new*q2_vw_new + q2_wi_new*q1_vw_new + q3_wi_new*q0_vw_new) - q2_ic_new*(q1_wi_new*q1_vw_new - q0_wi_new*q0_vw_new + q2_wi_new*q2_vw_new + q3_wi_new*q3_vw_new) - q3_ic_new*(q0_wi_new*q1_vw_new + q1_wi_new*q0_vw_new - q2_wi_new*q3_vw_new + q3_wi_new*q2_vw_new))*(q1_ic_old*q1_wi_old - q0_ic_old*q0_wi_old + q2_ic_old*q2_wi_old + q3_ic_old*q3_wi_old) + (q0_ic_new*(q0_wi_new*q3_vw_new - q1_wi_new*q2_vw_new + q2_wi_new*q1_vw_new + q3_wi_new*q0_vw_new) - q1_ic_new*(q0_wi_new*q2_vw_new + q2_wi_new*q0_vw_new + q1_wi_new*q3_vw_new - q3_wi_new*q1_vw_new) + q2_ic_new*(q0_wi_new*q1_vw_new + q1_wi_new*q0_vw_new - q2_wi_new*q3_vw_new + q3_wi_new*q2_vw_new) - q3_ic_new*(q1_wi_new*q1_vw_new - q0_wi_new*q0_vw_new + q2_wi_new*q2_vw_new + q3_wi_new*q3_vw_new))*(q0_ic_old*q1_wi_old + q1_ic_old*q0_wi_old - q2_ic_old*q3_wi_old + q3_ic_old*q2_wi_old), (q0_ic_new*(q1_wi_new*q1_vw_new - q0_wi_new*q0_vw_new + q2_wi_new*q2_vw_new + q3_wi_new*q3_vw_new) + q1_ic_new*(q0_wi_new*q1_vw_new + q1_wi_new*q0_vw_new - q2_wi_new*q3_vw_new + q3_wi_new*q2_vw_new) + q2_ic_new*(q0_wi_new*q2_vw_new + q2_wi_new*q0_vw_new + q1_wi_new*q3_vw_new - q3_wi_new*q1_vw_new) + q3_ic_new*(q0_wi_new*q3_vw_new - q1_wi_new*q2_vw_new + q2_wi_new*q1_vw_new + q3_wi_new*q0_vw_new))*(q0_ic_old*q1_wi_old + q1_ic_old*q0_wi_old - q2_ic_old*q3_wi_old + q3_ic_old*q2_wi_old) + (q0_ic_new*(q0_wi_new*q1_vw_new + q1_wi_new*q0_vw_new - q2_wi_new*q3_vw_new + q3_wi_new*q2_vw_new) - q1_ic_new*(q1_wi_new*q1_vw_new - q0_wi_new*q0_vw_new + q2_wi_new*q2_vw_new + q3_wi_new*q3_vw_new) - q2_ic_new*(q0_wi_new*q3_vw_new - q1_wi_new*q2_vw_new + q2_wi_new*q1_vw_new + q3_wi_new*q0_vw_new) + q3_ic_new*(q0_wi_new*q2_vw_new + q2_wi_new*q0_vw_new + q1_wi_new*q3_vw_new - q3_wi_new*q1_vw_new))*(q1_ic_old*q1_wi_old - q0_ic_old*q0_wi_old + q2_ic_old*q2_wi_old + q3_ic_old*q3_wi_old) + (q0_ic_new*(q0_wi_new*q2_vw_new + q2_wi_new*q0_vw_new + q1_wi_new*q3_vw_new - q3_wi_new*q1_vw_new) + q1_ic_new*(q0_wi_new*q3_vw_new - q1_wi_new*q2_vw_new + q2_wi_new*q1_vw_new + q3_wi_new*q0_vw_new) - q2_ic_new*(q1_wi_new*q1_vw_new - q0_wi_new*q0_vw_new + q2_wi_new*q2_vw_new + q3_wi_new*q3_vw_new) - q3_ic_new*(q0_wi_new*q1_vw_new + q1_wi_new*q0_vw_new - q2_wi_new*q3_vw_new + q3_wi_new*q2_vw_new))*(q0_ic_old*q3_wi_old - q1_ic_old*q2_wi_old + q2_ic_old*q1_wi_old + q3_ic_old*q0_wi_old) + (q0_ic_new*(q0_wi_new*q3_vw_new - q1_wi_new*q2_vw_new + q2_wi_new*q1_vw_new + q3_wi_new*q0_vw_new) - q1_ic_new*(q0_wi_new*q2_vw_new + q2_wi_new*q0_vw_new + q1_wi_new*q3_vw_new - q3_wi_new*q1_vw_new) + q2_ic_new*(q0_wi_new*q1_vw_new + q1_wi_new*q0_vw_new - q2_wi_new*q3_vw_new + q3_wi_new*q2_vw_new) - q3_ic_new*(q1_wi_new*q1_vw_new - q0_wi_new*q0_vw_new + q2_wi_new*q2_vw_new + q3_wi_new*q3_vw_new))*(q0_ic_old*q2_wi_old + q2_ic_old*q0_wi_old + q1_ic_old*q3_wi_old - q3_ic_old*q1_wi_old), (q0_ic_new*(q1_wi_new*q1_vw_new - q0_wi_new*q0_vw_new + q2_wi_new*q2_vw_new + q3_wi_new*q3_vw_new) + q1_ic_new*(q0_wi_new*q1_vw_new + q1_wi_new*q0_vw_new - q2_wi_new*q3_vw_new + q3_wi_new*q2_vw_new) + q2_ic_new*(q0_wi_new*q2_vw_new + q2_wi_new*q0_vw_new + q1_wi_new*q3_vw_new - q3_wi_new*q1_vw_new) + q3_ic_new*(q0_wi_new*q3_vw_new - q1_wi_new*q2_vw_new + q2_wi_new*q1_vw_new + q3_wi_new*q0_vw_new))*(q1_ic_old*q1_wi_old - q0_ic_old*q0_wi_old + q2_ic_old*q2_wi_old + q3_ic_old*q3_wi_old) - (q0_ic_new*(q0_wi_new*q1_vw_new + q1_wi_new*q0_vw_new - q2_wi_new*q3_vw_new + q3_wi_new*q2_vw_new) - q1_ic_new*(q1_wi_new*q1_vw_new - q0_wi_new*q0_vw_new + q2_wi_new*q2_vw_new + q3_wi_new*q3_vw_new) - q2_ic_new*(q0_wi_new*q3_vw_new - q1_wi_new*q2_vw_new + q2_wi_new*q1_vw_new + q3_wi_new*q0_vw_new) + q3_ic_new*(q0_wi_new*q2_vw_new + q2_wi_new*q0_vw_new + q1_wi_new*q3_vw_new - q3_wi_new*q1_vw_new))*(q0_ic_old*q1_wi_old + q1_ic_old*q0_wi_old - q2_ic_old*q3_wi_old + q3_ic_old*q2_wi_old) - (q0_ic_new*(q0_wi_new*q2_vw_new + q2_wi_new*q0_vw_new + q1_wi_new*q3_vw_new - q3_wi_new*q1_vw_new) + q1_ic_new*(q0_wi_new*q3_vw_new - q1_wi_new*q2_vw_new + q2_wi_new*q1_vw_new + q3_wi_new*q0_vw_new) - q2_ic_new*(q1_wi_new*q1_vw_new - q0_wi_new*q0_vw_new + q2_wi_new*q2_vw_new + q3_wi_new*q3_vw_new) - q3_ic_new*(q0_wi_new*q1_vw_new + q1_wi_new*q0_vw_new - q2_wi_new*q3_vw_new + q3_wi_new*q2_vw_new))*(q0_ic_old*q2_wi_old + q2_ic_old*q0_wi_old + q1_ic_old*q3_wi_old - q3_ic_old*q1_wi_old) + (q0_ic_new*(q0_wi_new*q3_vw_new - q1_wi_new*q2_vw_new + q2_wi_new*q1_vw_new + q3_wi_new*q0_vw_new) - q1_ic_new*(q0_wi_new*q2_vw_new + q2_wi_new*q0_vw_new + q1_wi_new*q3_vw_new - q3_wi_new*q1_vw_new) + q2_ic_new*(q0_wi_new*q1_vw_new + q1_wi_new*q0_vw_new - q2_wi_new*q3_vw_new + q3_wi_new*q2_vw_new) - q3_ic_new*(q1_wi_new*q1_vw_new - q0_wi_new*q0_vw_new + q2_wi_new*q2_vw_new + q3_wi_new*q3_vw_new))*(q0_ic_old*q3_wi_old - q1_ic_old*q2_wi_old + q2_ic_old*q1_wi_old + q3_ic_old*q0_wi_old)]];

elseif (param.fusion.camFixQuatvw == 1)
    H_z_q_relative_qvw_old = zeros(4,4);
                
end 


%% qH(k+m)

% qH(k+m)(q_wi) = delta(z_q_relative) / delta(q_wi_k+m)
H_z_q_relative_qwi_new = [[ (q0_ic_old*(q1_wi_old*q1_vw_old - q0_wi_old*q0_vw_old + q2_wi_old*q2_vw_old + q3_wi_old*q3_vw_old) + q1_ic_old*(q0_wi_old*q1_vw_old + q1_wi_old*q0_vw_old - q2_wi_old*q3_vw_old + q3_wi_old*q2_vw_old) + q2_ic_old*(q0_wi_old*q2_vw_old + q2_wi_old*q0_vw_old + q1_wi_old*q3_vw_old - q3_wi_old*q1_vw_old) + q3_ic_old*(q0_wi_old*q3_vw_old - q1_wi_old*q2_vw_old + q2_wi_old*q1_vw_old + q3_wi_old*q0_vw_old))*(q1_ic_new*q1_vw_new - q0_ic_new*q0_vw_new + q2_ic_new*q2_vw_new + q3_ic_new*q3_vw_new) + (q0_ic_old*(q0_wi_old*q1_vw_old + q1_wi_old*q0_vw_old - q2_wi_old*q3_vw_old + q3_wi_old*q2_vw_old) - q1_ic_old*(q1_wi_old*q1_vw_old - q0_wi_old*q0_vw_old + q2_wi_old*q2_vw_old + q3_wi_old*q3_vw_old) - q2_ic_old*(q0_wi_old*q3_vw_old - q1_wi_old*q2_vw_old + q2_wi_old*q1_vw_old + q3_wi_old*q0_vw_old) + q3_ic_old*(q0_wi_old*q2_vw_old + q2_wi_old*q0_vw_old + q1_wi_old*q3_vw_old - q3_wi_old*q1_vw_old))*(q0_ic_new*q1_vw_new + q1_ic_new*q0_vw_new - q2_ic_new*q3_vw_new + q3_ic_new*q2_vw_new) + (q0_ic_old*(q0_wi_old*q2_vw_old + q2_wi_old*q0_vw_old + q1_wi_old*q3_vw_old - q3_wi_old*q1_vw_old) + q1_ic_old*(q0_wi_old*q3_vw_old - q1_wi_old*q2_vw_old + q2_wi_old*q1_vw_old + q3_wi_old*q0_vw_old) - q2_ic_old*(q1_wi_old*q1_vw_old - q0_wi_old*q0_vw_old + q2_wi_old*q2_vw_old + q3_wi_old*q3_vw_old) - q3_ic_old*(q0_wi_old*q1_vw_old + q1_wi_old*q0_vw_old - q2_wi_old*q3_vw_old + q3_wi_old*q2_vw_old))*(q0_ic_new*q2_vw_new + q2_ic_new*q0_vw_new + q1_ic_new*q3_vw_new - q3_ic_new*q1_vw_new) + (q0_ic_old*(q0_wi_old*q3_vw_old - q1_wi_old*q2_vw_old + q2_wi_old*q1_vw_old + q3_wi_old*q0_vw_old) - q1_ic_old*(q0_wi_old*q2_vw_old + q2_wi_old*q0_vw_old + q1_wi_old*q3_vw_old - q3_wi_old*q1_vw_old) + q2_ic_old*(q0_wi_old*q1_vw_old + q1_wi_old*q0_vw_old - q2_wi_old*q3_vw_old + q3_wi_old*q2_vw_old) - q3_ic_old*(q1_wi_old*q1_vw_old - q0_wi_old*q0_vw_old + q2_wi_old*q2_vw_old + q3_wi_old*q3_vw_old))*(q0_ic_new*q3_vw_new - q1_ic_new*q2_vw_new + q2_ic_new*q1_vw_new + q3_ic_new*q0_vw_new),   (q0_ic_old*(q1_wi_old*q1_vw_old - q0_wi_old*q0_vw_old + q2_wi_old*q2_vw_old + q3_wi_old*q3_vw_old) + q1_ic_old*(q0_wi_old*q1_vw_old + q1_wi_old*q0_vw_old - q2_wi_old*q3_vw_old + q3_wi_old*q2_vw_old) + q2_ic_old*(q0_wi_old*q2_vw_old + q2_wi_old*q0_vw_old + q1_wi_old*q3_vw_old - q3_wi_old*q1_vw_old) + q3_ic_old*(q0_wi_old*q3_vw_old - q1_wi_old*q2_vw_old + q2_wi_old*q1_vw_old + q3_wi_old*q0_vw_old))*(q0_ic_new*q1_vw_new + q1_ic_new*q0_vw_new + q2_ic_new*q3_vw_new - q3_ic_new*q2_vw_new) + (q0_ic_old*(q0_wi_old*q1_vw_old + q1_wi_old*q0_vw_old - q2_wi_old*q3_vw_old + q3_wi_old*q2_vw_old) - q1_ic_old*(q1_wi_old*q1_vw_old - q0_wi_old*q0_vw_old + q2_wi_old*q2_vw_old + q3_wi_old*q3_vw_old) - q2_ic_old*(q0_wi_old*q3_vw_old - q1_wi_old*q2_vw_old + q2_wi_old*q1_vw_old + q3_wi_old*q0_vw_old) + q3_ic_old*(q0_wi_old*q2_vw_old + q2_wi_old*q0_vw_old + q1_wi_old*q3_vw_old - q3_wi_old*q1_vw_old))*(q0_ic_new*q0_vw_new - q1_ic_new*q1_vw_new + q2_ic_new*q2_vw_new + q3_ic_new*q3_vw_new) - (q0_ic_old*(q0_wi_old*q2_vw_old + q2_wi_old*q0_vw_old + q1_wi_old*q3_vw_old - q3_wi_old*q1_vw_old) + q1_ic_old*(q0_wi_old*q3_vw_old - q1_wi_old*q2_vw_old + q2_wi_old*q1_vw_old + q3_wi_old*q0_vw_old) - q2_ic_old*(q1_wi_old*q1_vw_old - q0_wi_old*q0_vw_old + q2_wi_old*q2_vw_old + q3_wi_old*q3_vw_old) - q3_ic_old*(q0_wi_old*q1_vw_old + q1_wi_old*q0_vw_old - q2_wi_old*q3_vw_old + q3_wi_old*q2_vw_old))*(q1_ic_new*q2_vw_new - q0_ic_new*q3_vw_new + q2_ic_new*q1_vw_new + q3_ic_new*q0_vw_new) - (q0_ic_old*(q0_wi_old*q3_vw_old - q1_wi_old*q2_vw_old + q2_wi_old*q1_vw_old + q3_wi_old*q0_vw_old) - q1_ic_old*(q0_wi_old*q2_vw_old + q2_wi_old*q0_vw_old + q1_wi_old*q3_vw_old - q3_wi_old*q1_vw_old) + q2_ic_old*(q0_wi_old*q1_vw_old + q1_wi_old*q0_vw_old - q2_wi_old*q3_vw_old + q3_wi_old*q2_vw_old) - q3_ic_old*(q1_wi_old*q1_vw_old - q0_wi_old*q0_vw_old + q2_wi_old*q2_vw_old + q3_wi_old*q3_vw_old))*(q0_ic_new*q2_vw_new - q2_ic_new*q0_vw_new + q1_ic_new*q3_vw_new + q3_ic_new*q1_vw_new),   (q0_ic_old*(q1_wi_old*q1_vw_old - q0_wi_old*q0_vw_old + q2_wi_old*q2_vw_old + q3_wi_old*q3_vw_old) + q1_ic_old*(q0_wi_old*q1_vw_old + q1_wi_old*q0_vw_old - q2_wi_old*q3_vw_old + q3_wi_old*q2_vw_old) + q2_ic_old*(q0_wi_old*q2_vw_old + q2_wi_old*q0_vw_old + q1_wi_old*q3_vw_old - q3_wi_old*q1_vw_old) + q3_ic_old*(q0_wi_old*q3_vw_old - q1_wi_old*q2_vw_old + q2_wi_old*q1_vw_old + q3_wi_old*q0_vw_old))*(q0_ic_new*q2_vw_new + q2_ic_new*q0_vw_new - q1_ic_new*q3_vw_new + q3_ic_new*q1_vw_new) - (q0_ic_old*(q0_wi_old*q1_vw_old + q1_wi_old*q0_vw_old - q2_wi_old*q3_vw_old + q3_wi_old*q2_vw_old) - q1_ic_old*(q1_wi_old*q1_vw_old - q0_wi_old*q0_vw_old + q2_wi_old*q2_vw_old + q3_wi_old*q3_vw_old) - q2_ic_old*(q0_wi_old*q3_vw_old - q1_wi_old*q2_vw_old + q2_wi_old*q1_vw_old + q3_wi_old*q0_vw_old) + q3_ic_old*(q0_wi_old*q2_vw_old + q2_wi_old*q0_vw_old + q1_wi_old*q3_vw_old - q3_wi_old*q1_vw_old))*(q0_ic_new*q3_vw_new + q1_ic_new*q2_vw_new + q2_ic_new*q1_vw_new - q3_ic_new*q0_vw_new) + (q0_ic_old*(q0_wi_old*q2_vw_old + q2_wi_old*q0_vw_old + q1_wi_old*q3_vw_old - q3_wi_old*q1_vw_old) + q1_ic_old*(q0_wi_old*q3_vw_old - q1_wi_old*q2_vw_old + q2_wi_old*q1_vw_old + q3_wi_old*q0_vw_old) - q2_ic_old*(q1_wi_old*q1_vw_old - q0_wi_old*q0_vw_old + q2_wi_old*q2_vw_old + q3_wi_old*q3_vw_old) - q3_ic_old*(q0_wi_old*q1_vw_old + q1_wi_old*q0_vw_old - q2_wi_old*q3_vw_old + q3_wi_old*q2_vw_old))*(q0_ic_new*q0_vw_new + q1_ic_new*q1_vw_new - q2_ic_new*q2_vw_new + q3_ic_new*q3_vw_new) - (q0_ic_old*(q0_wi_old*q3_vw_old - q1_wi_old*q2_vw_old + q2_wi_old*q1_vw_old + q3_wi_old*q0_vw_old) - q1_ic_old*(q0_wi_old*q2_vw_old + q2_wi_old*q0_vw_old + q1_wi_old*q3_vw_old - q3_wi_old*q1_vw_old) + q2_ic_old*(q0_wi_old*q1_vw_old + q1_wi_old*q0_vw_old - q2_wi_old*q3_vw_old + q3_wi_old*q2_vw_old) - q3_ic_old*(q1_wi_old*q1_vw_old - q0_wi_old*q0_vw_old + q2_wi_old*q2_vw_old + q3_wi_old*q3_vw_old))*(q1_ic_new*q0_vw_new - q0_ic_new*q1_vw_new + q2_ic_new*q3_vw_new + q3_ic_new*q2_vw_new),   (q0_ic_old*(q1_wi_old*q1_vw_old - q0_wi_old*q0_vw_old + q2_wi_old*q2_vw_old + q3_wi_old*q3_vw_old) + q1_ic_old*(q0_wi_old*q1_vw_old + q1_wi_old*q0_vw_old - q2_wi_old*q3_vw_old + q3_wi_old*q2_vw_old) + q2_ic_old*(q0_wi_old*q2_vw_old + q2_wi_old*q0_vw_old + q1_wi_old*q3_vw_old - q3_wi_old*q1_vw_old) + q3_ic_old*(q0_wi_old*q3_vw_old - q1_wi_old*q2_vw_old + q2_wi_old*q1_vw_old + q3_wi_old*q0_vw_old))*(q0_ic_new*q3_vw_new + q1_ic_new*q2_vw_new - q2_ic_new*q1_vw_new + q3_ic_new*q0_vw_new) - (q0_ic_old*(q0_wi_old*q1_vw_old + q1_wi_old*q0_vw_old - q2_wi_old*q3_vw_old + q3_wi_old*q2_vw_old) - q1_ic_old*(q1_wi_old*q1_vw_old - q0_wi_old*q0_vw_old + q2_wi_old*q2_vw_old + q3_wi_old*q3_vw_old) - q2_ic_old*(q0_wi_old*q3_vw_old - q1_wi_old*q2_vw_old + q2_wi_old*q1_vw_old + q3_wi_old*q0_vw_old) + q3_ic_old*(q0_wi_old*q2_vw_old + q2_wi_old*q0_vw_old + q1_wi_old*q3_vw_old - q3_wi_old*q1_vw_old))*(q2_ic_new*q0_vw_new - q0_ic_new*q2_vw_new + q1_ic_new*q3_vw_new + q3_ic_new*q1_vw_new) - (q0_ic_old*(q0_wi_old*q2_vw_old + q2_wi_old*q0_vw_old + q1_wi_old*q3_vw_old - q3_wi_old*q1_vw_old) + q1_ic_old*(q0_wi_old*q3_vw_old - q1_wi_old*q2_vw_old + q2_wi_old*q1_vw_old + q3_wi_old*q0_vw_old) - q2_ic_old*(q1_wi_old*q1_vw_old - q0_wi_old*q0_vw_old + q2_wi_old*q2_vw_old + q3_wi_old*q3_vw_old) - q3_ic_old*(q0_wi_old*q1_vw_old + q1_wi_old*q0_vw_old - q2_wi_old*q3_vw_old + q3_wi_old*q2_vw_old))*(q0_ic_new*q1_vw_new - q1_ic_new*q0_vw_new + q2_ic_new*q3_vw_new + q3_ic_new*q2_vw_new) + (q0_ic_old*(q0_wi_old*q3_vw_old - q1_wi_old*q2_vw_old + q2_wi_old*q1_vw_old + q3_wi_old*q0_vw_old) - q1_ic_old*(q0_wi_old*q2_vw_old + q2_wi_old*q0_vw_old + q1_wi_old*q3_vw_old - q3_wi_old*q1_vw_old) + q2_ic_old*(q0_wi_old*q1_vw_old + q1_wi_old*q0_vw_old - q2_wi_old*q3_vw_old + q3_wi_old*q2_vw_old) - q3_ic_old*(q1_wi_old*q1_vw_old - q0_wi_old*q0_vw_old + q2_wi_old*q2_vw_old + q3_wi_old*q3_vw_old))*(q0_ic_new*q0_vw_new + q1_ic_new*q1_vw_new + q2_ic_new*q2_vw_new - q3_ic_new*q3_vw_new)]
                          [ (q0_ic_old*(q1_wi_old*q1_vw_old - q0_wi_old*q0_vw_old + q2_wi_old*q2_vw_old + q3_wi_old*q3_vw_old) + q1_ic_old*(q0_wi_old*q1_vw_old + q1_wi_old*q0_vw_old - q2_wi_old*q3_vw_old + q3_wi_old*q2_vw_old) + q2_ic_old*(q0_wi_old*q2_vw_old + q2_wi_old*q0_vw_old + q1_wi_old*q3_vw_old - q3_wi_old*q1_vw_old) + q3_ic_old*(q0_wi_old*q3_vw_old - q1_wi_old*q2_vw_old + q2_wi_old*q1_vw_old + q3_wi_old*q0_vw_old))*(q0_ic_new*q1_vw_new + q1_ic_new*q0_vw_new - q2_ic_new*q3_vw_new + q3_ic_new*q2_vw_new) - (q0_ic_old*(q0_wi_old*q1_vw_old + q1_wi_old*q0_vw_old - q2_wi_old*q3_vw_old + q3_wi_old*q2_vw_old) - q1_ic_old*(q1_wi_old*q1_vw_old - q0_wi_old*q0_vw_old + q2_wi_old*q2_vw_old + q3_wi_old*q3_vw_old) - q2_ic_old*(q0_wi_old*q3_vw_old - q1_wi_old*q2_vw_old + q2_wi_old*q1_vw_old + q3_wi_old*q0_vw_old) + q3_ic_old*(q0_wi_old*q2_vw_old + q2_wi_old*q0_vw_old + q1_wi_old*q3_vw_old - q3_wi_old*q1_vw_old))*(q1_ic_new*q1_vw_new - q0_ic_new*q0_vw_new + q2_ic_new*q2_vw_new + q3_ic_new*q3_vw_new) + (q0_ic_old*(q0_wi_old*q2_vw_old + q2_wi_old*q0_vw_old + q1_wi_old*q3_vw_old - q3_wi_old*q1_vw_old) + q1_ic_old*(q0_wi_old*q3_vw_old - q1_wi_old*q2_vw_old + q2_wi_old*q1_vw_old + q3_wi_old*q0_vw_old) - q2_ic_old*(q1_wi_old*q1_vw_old - q0_wi_old*q0_vw_old + q2_wi_old*q2_vw_old + q3_wi_old*q3_vw_old) - q3_ic_old*(q0_wi_old*q1_vw_old + q1_wi_old*q0_vw_old - q2_wi_old*q3_vw_old + q3_wi_old*q2_vw_old))*(q0_ic_new*q3_vw_new - q1_ic_new*q2_vw_new + q2_ic_new*q1_vw_new + q3_ic_new*q0_vw_new) - (q0_ic_old*(q0_wi_old*q3_vw_old - q1_wi_old*q2_vw_old + q2_wi_old*q1_vw_old + q3_wi_old*q0_vw_old) - q1_ic_old*(q0_wi_old*q2_vw_old + q2_wi_old*q0_vw_old + q1_wi_old*q3_vw_old - q3_wi_old*q1_vw_old) + q2_ic_old*(q0_wi_old*q1_vw_old + q1_wi_old*q0_vw_old - q2_wi_old*q3_vw_old + q3_wi_old*q2_vw_old) - q3_ic_old*(q1_wi_old*q1_vw_old - q0_wi_old*q0_vw_old + q2_wi_old*q2_vw_old + q3_wi_old*q3_vw_old))*(q0_ic_new*q2_vw_new + q2_ic_new*q0_vw_new + q1_ic_new*q3_vw_new - q3_ic_new*q1_vw_new),   (q0_ic_old*(q1_wi_old*q1_vw_old - q0_wi_old*q0_vw_old + q2_wi_old*q2_vw_old + q3_wi_old*q3_vw_old) + q1_ic_old*(q0_wi_old*q1_vw_old + q1_wi_old*q0_vw_old - q2_wi_old*q3_vw_old + q3_wi_old*q2_vw_old) + q2_ic_old*(q0_wi_old*q2_vw_old + q2_wi_old*q0_vw_old + q1_wi_old*q3_vw_old - q3_wi_old*q1_vw_old) + q3_ic_old*(q0_wi_old*q3_vw_old - q1_wi_old*q2_vw_old + q2_wi_old*q1_vw_old + q3_wi_old*q0_vw_old))*(q0_ic_new*q0_vw_new - q1_ic_new*q1_vw_new + q2_ic_new*q2_vw_new + q3_ic_new*q3_vw_new) - (q0_ic_old*(q0_wi_old*q1_vw_old + q1_wi_old*q0_vw_old - q2_wi_old*q3_vw_old + q3_wi_old*q2_vw_old) - q1_ic_old*(q1_wi_old*q1_vw_old - q0_wi_old*q0_vw_old + q2_wi_old*q2_vw_old + q3_wi_old*q3_vw_old) - q2_ic_old*(q0_wi_old*q3_vw_old - q1_wi_old*q2_vw_old + q2_wi_old*q1_vw_old + q3_wi_old*q0_vw_old) + q3_ic_old*(q0_wi_old*q2_vw_old + q2_wi_old*q0_vw_old + q1_wi_old*q3_vw_old - q3_wi_old*q1_vw_old))*(q0_ic_new*q1_vw_new + q1_ic_new*q0_vw_new + q2_ic_new*q3_vw_new - q3_ic_new*q2_vw_new) - (q0_ic_old*(q0_wi_old*q2_vw_old + q2_wi_old*q0_vw_old + q1_wi_old*q3_vw_old - q3_wi_old*q1_vw_old) + q1_ic_old*(q0_wi_old*q3_vw_old - q1_wi_old*q2_vw_old + q2_wi_old*q1_vw_old + q3_wi_old*q0_vw_old) - q2_ic_old*(q1_wi_old*q1_vw_old - q0_wi_old*q0_vw_old + q2_wi_old*q2_vw_old + q3_wi_old*q3_vw_old) - q3_ic_old*(q0_wi_old*q1_vw_old + q1_wi_old*q0_vw_old - q2_wi_old*q3_vw_old + q3_wi_old*q2_vw_old))*(q0_ic_new*q2_vw_new - q2_ic_new*q0_vw_new + q1_ic_new*q3_vw_new + q3_ic_new*q1_vw_new) + (q0_ic_old*(q0_wi_old*q3_vw_old - q1_wi_old*q2_vw_old + q2_wi_old*q1_vw_old + q3_wi_old*q0_vw_old) - q1_ic_old*(q0_wi_old*q2_vw_old + q2_wi_old*q0_vw_old + q1_wi_old*q3_vw_old - q3_wi_old*q1_vw_old) + q2_ic_old*(q0_wi_old*q1_vw_old + q1_wi_old*q0_vw_old - q2_wi_old*q3_vw_old + q3_wi_old*q2_vw_old) - q3_ic_old*(q1_wi_old*q1_vw_old - q0_wi_old*q0_vw_old + q2_wi_old*q2_vw_old + q3_wi_old*q3_vw_old))*(q1_ic_new*q2_vw_new - q0_ic_new*q3_vw_new + q2_ic_new*q1_vw_new + q3_ic_new*q0_vw_new), - (q0_ic_old*(q1_wi_old*q1_vw_old - q0_wi_old*q0_vw_old + q2_wi_old*q2_vw_old + q3_wi_old*q3_vw_old) + q1_ic_old*(q0_wi_old*q1_vw_old + q1_wi_old*q0_vw_old - q2_wi_old*q3_vw_old + q3_wi_old*q2_vw_old) + q2_ic_old*(q0_wi_old*q2_vw_old + q2_wi_old*q0_vw_old + q1_wi_old*q3_vw_old - q3_wi_old*q1_vw_old) + q3_ic_old*(q0_wi_old*q3_vw_old - q1_wi_old*q2_vw_old + q2_wi_old*q1_vw_old + q3_wi_old*q0_vw_old))*(q0_ic_new*q3_vw_new + q1_ic_new*q2_vw_new + q2_ic_new*q1_vw_new - q3_ic_new*q0_vw_new) - (q0_ic_old*(q0_wi_old*q1_vw_old + q1_wi_old*q0_vw_old - q2_wi_old*q3_vw_old + q3_wi_old*q2_vw_old) - q1_ic_old*(q1_wi_old*q1_vw_old - q0_wi_old*q0_vw_old + q2_wi_old*q2_vw_old + q3_wi_old*q3_vw_old) - q2_ic_old*(q0_wi_old*q3_vw_old - q1_wi_old*q2_vw_old + q2_wi_old*q1_vw_old + q3_wi_old*q0_vw_old) + q3_ic_old*(q0_wi_old*q2_vw_old + q2_wi_old*q0_vw_old + q1_wi_old*q3_vw_old - q3_wi_old*q1_vw_old))*(q0_ic_new*q2_vw_new + q2_ic_new*q0_vw_new - q1_ic_new*q3_vw_new + q3_ic_new*q1_vw_new) - (q0_ic_old*(q0_wi_old*q2_vw_old + q2_wi_old*q0_vw_old + q1_wi_old*q3_vw_old - q3_wi_old*q1_vw_old) + q1_ic_old*(q0_wi_old*q3_vw_old - q1_wi_old*q2_vw_old + q2_wi_old*q1_vw_old + q3_wi_old*q0_vw_old) - q2_ic_old*(q1_wi_old*q1_vw_old - q0_wi_old*q0_vw_old + q2_wi_old*q2_vw_old + q3_wi_old*q3_vw_old) - q3_ic_old*(q0_wi_old*q1_vw_old + q1_wi_old*q0_vw_old - q2_wi_old*q3_vw_old + q3_wi_old*q2_vw_old))*(q1_ic_new*q0_vw_new - q0_ic_new*q1_vw_new + q2_ic_new*q3_vw_new + q3_ic_new*q2_vw_new) - (q0_ic_old*(q0_wi_old*q3_vw_old - q1_wi_old*q2_vw_old + q2_wi_old*q1_vw_old + q3_wi_old*q0_vw_old) - q1_ic_old*(q0_wi_old*q2_vw_old + q2_wi_old*q0_vw_old + q1_wi_old*q3_vw_old - q3_wi_old*q1_vw_old) + q2_ic_old*(q0_wi_old*q1_vw_old + q1_wi_old*q0_vw_old - q2_wi_old*q3_vw_old + q3_wi_old*q2_vw_old) - q3_ic_old*(q1_wi_old*q1_vw_old - q0_wi_old*q0_vw_old + q2_wi_old*q2_vw_old + q3_wi_old*q3_vw_old))*(q0_ic_new*q0_vw_new + q1_ic_new*q1_vw_new - q2_ic_new*q2_vw_new + q3_ic_new*q3_vw_new),   (q0_ic_old*(q0_wi_old*q2_vw_old + q2_wi_old*q0_vw_old + q1_wi_old*q3_vw_old - q3_wi_old*q1_vw_old) + q1_ic_old*(q0_wi_old*q3_vw_old - q1_wi_old*q2_vw_old + q2_wi_old*q1_vw_old + q3_wi_old*q0_vw_old) - q2_ic_old*(q1_wi_old*q1_vw_old - q0_wi_old*q0_vw_old + q2_wi_old*q2_vw_old + q3_wi_old*q3_vw_old) - q3_ic_old*(q0_wi_old*q1_vw_old + q1_wi_old*q0_vw_old - q2_wi_old*q3_vw_old + q3_wi_old*q2_vw_old))*(q0_ic_new*q0_vw_new + q1_ic_new*q1_vw_new + q2_ic_new*q2_vw_new - q3_ic_new*q3_vw_new) - (q0_ic_old*(q0_wi_old*q1_vw_old + q1_wi_old*q0_vw_old - q2_wi_old*q3_vw_old + q3_wi_old*q2_vw_old) - q1_ic_old*(q1_wi_old*q1_vw_old - q0_wi_old*q0_vw_old + q2_wi_old*q2_vw_old + q3_wi_old*q3_vw_old) - q2_ic_old*(q0_wi_old*q3_vw_old - q1_wi_old*q2_vw_old + q2_wi_old*q1_vw_old + q3_wi_old*q0_vw_old) + q3_ic_old*(q0_wi_old*q2_vw_old + q2_wi_old*q0_vw_old + q1_wi_old*q3_vw_old - q3_wi_old*q1_vw_old))*(q0_ic_new*q3_vw_new + q1_ic_new*q2_vw_new - q2_ic_new*q1_vw_new + q3_ic_new*q0_vw_new) - (q0_ic_old*(q1_wi_old*q1_vw_old - q0_wi_old*q0_vw_old + q2_wi_old*q2_vw_old + q3_wi_old*q3_vw_old) + q1_ic_old*(q0_wi_old*q1_vw_old + q1_wi_old*q0_vw_old - q2_wi_old*q3_vw_old + q3_wi_old*q2_vw_old) + q2_ic_old*(q0_wi_old*q2_vw_old + q2_wi_old*q0_vw_old + q1_wi_old*q3_vw_old - q3_wi_old*q1_vw_old) + q3_ic_old*(q0_wi_old*q3_vw_old - q1_wi_old*q2_vw_old + q2_wi_old*q1_vw_old + q3_wi_old*q0_vw_old))*(q2_ic_new*q0_vw_new - q0_ic_new*q2_vw_new + q1_ic_new*q3_vw_new + q3_ic_new*q1_vw_new) + (q0_ic_old*(q0_wi_old*q3_vw_old - q1_wi_old*q2_vw_old + q2_wi_old*q1_vw_old + q3_wi_old*q0_vw_old) - q1_ic_old*(q0_wi_old*q2_vw_old + q2_wi_old*q0_vw_old + q1_wi_old*q3_vw_old - q3_wi_old*q1_vw_old) + q2_ic_old*(q0_wi_old*q1_vw_old + q1_wi_old*q0_vw_old - q2_wi_old*q3_vw_old + q3_wi_old*q2_vw_old) - q3_ic_old*(q1_wi_old*q1_vw_old - q0_wi_old*q0_vw_old + q2_wi_old*q2_vw_old + q3_wi_old*q3_vw_old))*(q0_ic_new*q1_vw_new - q1_ic_new*q0_vw_new + q2_ic_new*q3_vw_new + q3_ic_new*q2_vw_new)]
                          [ (q0_ic_old*(q1_wi_old*q1_vw_old - q0_wi_old*q0_vw_old + q2_wi_old*q2_vw_old + q3_wi_old*q3_vw_old) + q1_ic_old*(q0_wi_old*q1_vw_old + q1_wi_old*q0_vw_old - q2_wi_old*q3_vw_old + q3_wi_old*q2_vw_old) + q2_ic_old*(q0_wi_old*q2_vw_old + q2_wi_old*q0_vw_old + q1_wi_old*q3_vw_old - q3_wi_old*q1_vw_old) + q3_ic_old*(q0_wi_old*q3_vw_old - q1_wi_old*q2_vw_old + q2_wi_old*q1_vw_old + q3_wi_old*q0_vw_old))*(q0_ic_new*q2_vw_new + q2_ic_new*q0_vw_new + q1_ic_new*q3_vw_new - q3_ic_new*q1_vw_new) - (q0_ic_old*(q0_wi_old*q1_vw_old + q1_wi_old*q0_vw_old - q2_wi_old*q3_vw_old + q3_wi_old*q2_vw_old) - q1_ic_old*(q1_wi_old*q1_vw_old - q0_wi_old*q0_vw_old + q2_wi_old*q2_vw_old + q3_wi_old*q3_vw_old) - q2_ic_old*(q0_wi_old*q3_vw_old - q1_wi_old*q2_vw_old + q2_wi_old*q1_vw_old + q3_wi_old*q0_vw_old) + q3_ic_old*(q0_wi_old*q2_vw_old + q2_wi_old*q0_vw_old + q1_wi_old*q3_vw_old - q3_wi_old*q1_vw_old))*(q0_ic_new*q3_vw_new - q1_ic_new*q2_vw_new + q2_ic_new*q1_vw_new + q3_ic_new*q0_vw_new) - (q0_ic_old*(q0_wi_old*q2_vw_old + q2_wi_old*q0_vw_old + q1_wi_old*q3_vw_old - q3_wi_old*q1_vw_old) + q1_ic_old*(q0_wi_old*q3_vw_old - q1_wi_old*q2_vw_old + q2_wi_old*q1_vw_old + q3_wi_old*q0_vw_old) - q2_ic_old*(q1_wi_old*q1_vw_old - q0_wi_old*q0_vw_old + q2_wi_old*q2_vw_old + q3_wi_old*q3_vw_old) - q3_ic_old*(q0_wi_old*q1_vw_old + q1_wi_old*q0_vw_old - q2_wi_old*q3_vw_old + q3_wi_old*q2_vw_old))*(q1_ic_new*q1_vw_new - q0_ic_new*q0_vw_new + q2_ic_new*q2_vw_new + q3_ic_new*q3_vw_new) + (q0_ic_old*(q0_wi_old*q3_vw_old - q1_wi_old*q2_vw_old + q2_wi_old*q1_vw_old + q3_wi_old*q0_vw_old) - q1_ic_old*(q0_wi_old*q2_vw_old + q2_wi_old*q0_vw_old + q1_wi_old*q3_vw_old - q3_wi_old*q1_vw_old) + q2_ic_old*(q0_wi_old*q1_vw_old + q1_wi_old*q0_vw_old - q2_wi_old*q3_vw_old + q3_wi_old*q2_vw_old) - q3_ic_old*(q1_wi_old*q1_vw_old - q0_wi_old*q0_vw_old + q2_wi_old*q2_vw_old + q3_wi_old*q3_vw_old))*(q0_ic_new*q1_vw_new + q1_ic_new*q0_vw_new - q2_ic_new*q3_vw_new + q3_ic_new*q2_vw_new),   (q0_ic_old*(q0_wi_old*q1_vw_old + q1_wi_old*q0_vw_old - q2_wi_old*q3_vw_old + q3_wi_old*q2_vw_old) - q1_ic_old*(q1_wi_old*q1_vw_old - q0_wi_old*q0_vw_old + q2_wi_old*q2_vw_old + q3_wi_old*q3_vw_old) - q2_ic_old*(q0_wi_old*q3_vw_old - q1_wi_old*q2_vw_old + q2_wi_old*q1_vw_old + q3_wi_old*q0_vw_old) + q3_ic_old*(q0_wi_old*q2_vw_old + q2_wi_old*q0_vw_old + q1_wi_old*q3_vw_old - q3_wi_old*q1_vw_old))*(q0_ic_new*q2_vw_new - q2_ic_new*q0_vw_new + q1_ic_new*q3_vw_new + q3_ic_new*q1_vw_new) - (q0_ic_old*(q1_wi_old*q1_vw_old - q0_wi_old*q0_vw_old + q2_wi_old*q2_vw_old + q3_wi_old*q3_vw_old) + q1_ic_old*(q0_wi_old*q1_vw_old + q1_wi_old*q0_vw_old - q2_wi_old*q3_vw_old + q3_wi_old*q2_vw_old) + q2_ic_old*(q0_wi_old*q2_vw_old + q2_wi_old*q0_vw_old + q1_wi_old*q3_vw_old - q3_wi_old*q1_vw_old) + q3_ic_old*(q0_wi_old*q3_vw_old - q1_wi_old*q2_vw_old + q2_wi_old*q1_vw_old + q3_wi_old*q0_vw_old))*(q1_ic_new*q2_vw_new - q0_ic_new*q3_vw_new + q2_ic_new*q1_vw_new + q3_ic_new*q0_vw_new) - (q0_ic_old*(q0_wi_old*q2_vw_old + q2_wi_old*q0_vw_old + q1_wi_old*q3_vw_old - q3_wi_old*q1_vw_old) + q1_ic_old*(q0_wi_old*q3_vw_old - q1_wi_old*q2_vw_old + q2_wi_old*q1_vw_old + q3_wi_old*q0_vw_old) - q2_ic_old*(q1_wi_old*q1_vw_old - q0_wi_old*q0_vw_old + q2_wi_old*q2_vw_old + q3_wi_old*q3_vw_old) - q3_ic_old*(q0_wi_old*q1_vw_old + q1_wi_old*q0_vw_old - q2_wi_old*q3_vw_old + q3_wi_old*q2_vw_old))*(q0_ic_new*q1_vw_new + q1_ic_new*q0_vw_new + q2_ic_new*q3_vw_new - q3_ic_new*q2_vw_new) + (q0_ic_old*(q0_wi_old*q3_vw_old - q1_wi_old*q2_vw_old + q2_wi_old*q1_vw_old + q3_wi_old*q0_vw_old) - q1_ic_old*(q0_wi_old*q2_vw_old + q2_wi_old*q0_vw_old + q1_wi_old*q3_vw_old - q3_wi_old*q1_vw_old) + q2_ic_old*(q0_wi_old*q1_vw_old + q1_wi_old*q0_vw_old - q2_wi_old*q3_vw_old + q3_wi_old*q2_vw_old) - q3_ic_old*(q1_wi_old*q1_vw_old - q0_wi_old*q0_vw_old + q2_wi_old*q2_vw_old + q3_wi_old*q3_vw_old))*(q0_ic_new*q0_vw_new - q1_ic_new*q1_vw_new + q2_ic_new*q2_vw_new + q3_ic_new*q3_vw_new),   (q0_ic_old*(q1_wi_old*q1_vw_old - q0_wi_old*q0_vw_old + q2_wi_old*q2_vw_old + q3_wi_old*q3_vw_old) + q1_ic_old*(q0_wi_old*q1_vw_old + q1_wi_old*q0_vw_old - q2_wi_old*q3_vw_old + q3_wi_old*q2_vw_old) + q2_ic_old*(q0_wi_old*q2_vw_old + q2_wi_old*q0_vw_old + q1_wi_old*q3_vw_old - q3_wi_old*q1_vw_old) + q3_ic_old*(q0_wi_old*q3_vw_old - q1_wi_old*q2_vw_old + q2_wi_old*q1_vw_old + q3_wi_old*q0_vw_old))*(q0_ic_new*q0_vw_new + q1_ic_new*q1_vw_new - q2_ic_new*q2_vw_new + q3_ic_new*q3_vw_new) + (q0_ic_old*(q0_wi_old*q1_vw_old + q1_wi_old*q0_vw_old - q2_wi_old*q3_vw_old + q3_wi_old*q2_vw_old) - q1_ic_old*(q1_wi_old*q1_vw_old - q0_wi_old*q0_vw_old + q2_wi_old*q2_vw_old + q3_wi_old*q3_vw_old) - q2_ic_old*(q0_wi_old*q3_vw_old - q1_wi_old*q2_vw_old + q2_wi_old*q1_vw_old + q3_wi_old*q0_vw_old) + q3_ic_old*(q0_wi_old*q2_vw_old + q2_wi_old*q0_vw_old + q1_wi_old*q3_vw_old - q3_wi_old*q1_vw_old))*(q1_ic_new*q0_vw_new - q0_ic_new*q1_vw_new + q2_ic_new*q3_vw_new + q3_ic_new*q2_vw_new) - (q0_ic_old*(q0_wi_old*q2_vw_old + q2_wi_old*q0_vw_old + q1_wi_old*q3_vw_old - q3_wi_old*q1_vw_old) + q1_ic_old*(q0_wi_old*q3_vw_old - q1_wi_old*q2_vw_old + q2_wi_old*q1_vw_old + q3_wi_old*q0_vw_old) - q2_ic_old*(q1_wi_old*q1_vw_old - q0_wi_old*q0_vw_old + q2_wi_old*q2_vw_old + q3_wi_old*q3_vw_old) - q3_ic_old*(q0_wi_old*q1_vw_old + q1_wi_old*q0_vw_old - q2_wi_old*q3_vw_old + q3_wi_old*q2_vw_old))*(q0_ic_new*q2_vw_new + q2_ic_new*q0_vw_new - q1_ic_new*q3_vw_new + q3_ic_new*q1_vw_new) - (q0_ic_old*(q0_wi_old*q3_vw_old - q1_wi_old*q2_vw_old + q2_wi_old*q1_vw_old + q3_wi_old*q0_vw_old) - q1_ic_old*(q0_wi_old*q2_vw_old + q2_wi_old*q0_vw_old + q1_wi_old*q3_vw_old - q3_wi_old*q1_vw_old) + q2_ic_old*(q0_wi_old*q1_vw_old + q1_wi_old*q0_vw_old - q2_wi_old*q3_vw_old + q3_wi_old*q2_vw_old) - q3_ic_old*(q1_wi_old*q1_vw_old - q0_wi_old*q0_vw_old + q2_wi_old*q2_vw_old + q3_wi_old*q3_vw_old))*(q0_ic_new*q3_vw_new + q1_ic_new*q2_vw_new + q2_ic_new*q1_vw_new - q3_ic_new*q0_vw_new), - (q0_ic_old*(q1_wi_old*q1_vw_old - q0_wi_old*q0_vw_old + q2_wi_old*q2_vw_old + q3_wi_old*q3_vw_old) + q1_ic_old*(q0_wi_old*q1_vw_old + q1_wi_old*q0_vw_old - q2_wi_old*q3_vw_old + q3_wi_old*q2_vw_old) + q2_ic_old*(q0_wi_old*q2_vw_old + q2_wi_old*q0_vw_old + q1_wi_old*q3_vw_old - q3_wi_old*q1_vw_old) + q3_ic_old*(q0_wi_old*q3_vw_old - q1_wi_old*q2_vw_old + q2_wi_old*q1_vw_old + q3_wi_old*q0_vw_old))*(q0_ic_new*q1_vw_new - q1_ic_new*q0_vw_new + q2_ic_new*q3_vw_new + q3_ic_new*q2_vw_new) - (q0_ic_old*(q0_wi_old*q1_vw_old + q1_wi_old*q0_vw_old - q2_wi_old*q3_vw_old + q3_wi_old*q2_vw_old) - q1_ic_old*(q1_wi_old*q1_vw_old - q0_wi_old*q0_vw_old + q2_wi_old*q2_vw_old + q3_wi_old*q3_vw_old) - q2_ic_old*(q0_wi_old*q3_vw_old - q1_wi_old*q2_vw_old + q2_wi_old*q1_vw_old + q3_wi_old*q0_vw_old) + q3_ic_old*(q0_wi_old*q2_vw_old + q2_wi_old*q0_vw_old + q1_wi_old*q3_vw_old - q3_wi_old*q1_vw_old))*(q0_ic_new*q0_vw_new + q1_ic_new*q1_vw_new + q2_ic_new*q2_vw_new - q3_ic_new*q3_vw_new) - (q0_ic_old*(q0_wi_old*q2_vw_old + q2_wi_old*q0_vw_old + q1_wi_old*q3_vw_old - q3_wi_old*q1_vw_old) + q1_ic_old*(q0_wi_old*q3_vw_old - q1_wi_old*q2_vw_old + q2_wi_old*q1_vw_old + q3_wi_old*q0_vw_old) - q2_ic_old*(q1_wi_old*q1_vw_old - q0_wi_old*q0_vw_old + q2_wi_old*q2_vw_old + q3_wi_old*q3_vw_old) - q3_ic_old*(q0_wi_old*q1_vw_old + q1_wi_old*q0_vw_old - q2_wi_old*q3_vw_old + q3_wi_old*q2_vw_old))*(q0_ic_new*q3_vw_new + q1_ic_new*q2_vw_new - q2_ic_new*q1_vw_new + q3_ic_new*q0_vw_new) - (q0_ic_old*(q0_wi_old*q3_vw_old - q1_wi_old*q2_vw_old + q2_wi_old*q1_vw_old + q3_wi_old*q0_vw_old) - q1_ic_old*(q0_wi_old*q2_vw_old + q2_wi_old*q0_vw_old + q1_wi_old*q3_vw_old - q3_wi_old*q1_vw_old) + q2_ic_old*(q0_wi_old*q1_vw_old + q1_wi_old*q0_vw_old - q2_wi_old*q3_vw_old + q3_wi_old*q2_vw_old) - q3_ic_old*(q1_wi_old*q1_vw_old - q0_wi_old*q0_vw_old + q2_wi_old*q2_vw_old + q3_wi_old*q3_vw_old))*(q2_ic_new*q0_vw_new - q0_ic_new*q2_vw_new + q1_ic_new*q3_vw_new + q3_ic_new*q1_vw_new)]
                          [ (q0_ic_old*(q1_wi_old*q1_vw_old - q0_wi_old*q0_vw_old + q2_wi_old*q2_vw_old + q3_wi_old*q3_vw_old) + q1_ic_old*(q0_wi_old*q1_vw_old + q1_wi_old*q0_vw_old - q2_wi_old*q3_vw_old + q3_wi_old*q2_vw_old) + q2_ic_old*(q0_wi_old*q2_vw_old + q2_wi_old*q0_vw_old + q1_wi_old*q3_vw_old - q3_wi_old*q1_vw_old) + q3_ic_old*(q0_wi_old*q3_vw_old - q1_wi_old*q2_vw_old + q2_wi_old*q1_vw_old + q3_wi_old*q0_vw_old))*(q0_ic_new*q3_vw_new - q1_ic_new*q2_vw_new + q2_ic_new*q1_vw_new + q3_ic_new*q0_vw_new) + (q0_ic_old*(q0_wi_old*q1_vw_old + q1_wi_old*q0_vw_old - q2_wi_old*q3_vw_old + q3_wi_old*q2_vw_old) - q1_ic_old*(q1_wi_old*q1_vw_old - q0_wi_old*q0_vw_old + q2_wi_old*q2_vw_old + q3_wi_old*q3_vw_old) - q2_ic_old*(q0_wi_old*q3_vw_old - q1_wi_old*q2_vw_old + q2_wi_old*q1_vw_old + q3_wi_old*q0_vw_old) + q3_ic_old*(q0_wi_old*q2_vw_old + q2_wi_old*q0_vw_old + q1_wi_old*q3_vw_old - q3_wi_old*q1_vw_old))*(q0_ic_new*q2_vw_new + q2_ic_new*q0_vw_new + q1_ic_new*q3_vw_new - q3_ic_new*q1_vw_new) - (q0_ic_old*(q0_wi_old*q2_vw_old + q2_wi_old*q0_vw_old + q1_wi_old*q3_vw_old - q3_wi_old*q1_vw_old) + q1_ic_old*(q0_wi_old*q3_vw_old - q1_wi_old*q2_vw_old + q2_wi_old*q1_vw_old + q3_wi_old*q0_vw_old) - q2_ic_old*(q1_wi_old*q1_vw_old - q0_wi_old*q0_vw_old + q2_wi_old*q2_vw_old + q3_wi_old*q3_vw_old) - q3_ic_old*(q0_wi_old*q1_vw_old + q1_wi_old*q0_vw_old - q2_wi_old*q3_vw_old + q3_wi_old*q2_vw_old))*(q0_ic_new*q1_vw_new + q1_ic_new*q0_vw_new - q2_ic_new*q3_vw_new + q3_ic_new*q2_vw_new) - (q0_ic_old*(q0_wi_old*q3_vw_old - q1_wi_old*q2_vw_old + q2_wi_old*q1_vw_old + q3_wi_old*q0_vw_old) - q1_ic_old*(q0_wi_old*q2_vw_old + q2_wi_old*q0_vw_old + q1_wi_old*q3_vw_old - q3_wi_old*q1_vw_old) + q2_ic_old*(q0_wi_old*q1_vw_old + q1_wi_old*q0_vw_old - q2_wi_old*q3_vw_old + q3_wi_old*q2_vw_old) - q3_ic_old*(q1_wi_old*q1_vw_old - q0_wi_old*q0_vw_old + q2_wi_old*q2_vw_old + q3_wi_old*q3_vw_old))*(q1_ic_new*q1_vw_new - q0_ic_new*q0_vw_new + q2_ic_new*q2_vw_new + q3_ic_new*q3_vw_new), - (q0_ic_old*(q1_wi_old*q1_vw_old - q0_wi_old*q0_vw_old + q2_wi_old*q2_vw_old + q3_wi_old*q3_vw_old) + q1_ic_old*(q0_wi_old*q1_vw_old + q1_wi_old*q0_vw_old - q2_wi_old*q3_vw_old + q3_wi_old*q2_vw_old) + q2_ic_old*(q0_wi_old*q2_vw_old + q2_wi_old*q0_vw_old + q1_wi_old*q3_vw_old - q3_wi_old*q1_vw_old) + q3_ic_old*(q0_wi_old*q3_vw_old - q1_wi_old*q2_vw_old + q2_wi_old*q1_vw_old + q3_wi_old*q0_vw_old))*(q0_ic_new*q2_vw_new - q2_ic_new*q0_vw_new + q1_ic_new*q3_vw_new + q3_ic_new*q1_vw_new) - (q0_ic_old*(q0_wi_old*q1_vw_old + q1_wi_old*q0_vw_old - q2_wi_old*q3_vw_old + q3_wi_old*q2_vw_old) - q1_ic_old*(q1_wi_old*q1_vw_old - q0_wi_old*q0_vw_old + q2_wi_old*q2_vw_old + q3_wi_old*q3_vw_old) - q2_ic_old*(q0_wi_old*q3_vw_old - q1_wi_old*q2_vw_old + q2_wi_old*q1_vw_old + q3_wi_old*q0_vw_old) + q3_ic_old*(q0_wi_old*q2_vw_old + q2_wi_old*q0_vw_old + q1_wi_old*q3_vw_old - q3_wi_old*q1_vw_old))*(q1_ic_new*q2_vw_new - q0_ic_new*q3_vw_new + q2_ic_new*q1_vw_new + q3_ic_new*q0_vw_new) - (q0_ic_old*(q0_wi_old*q2_vw_old + q2_wi_old*q0_vw_old + q1_wi_old*q3_vw_old - q3_wi_old*q1_vw_old) + q1_ic_old*(q0_wi_old*q3_vw_old - q1_wi_old*q2_vw_old + q2_wi_old*q1_vw_old + q3_wi_old*q0_vw_old) - q2_ic_old*(q1_wi_old*q1_vw_old - q0_wi_old*q0_vw_old + q2_wi_old*q2_vw_old + q3_wi_old*q3_vw_old) - q3_ic_old*(q0_wi_old*q1_vw_old + q1_wi_old*q0_vw_old - q2_wi_old*q3_vw_old + q3_wi_old*q2_vw_old))*(q0_ic_new*q0_vw_new - q1_ic_new*q1_vw_new + q2_ic_new*q2_vw_new + q3_ic_new*q3_vw_new) - (q0_ic_old*(q0_wi_old*q3_vw_old - q1_wi_old*q2_vw_old + q2_wi_old*q1_vw_old + q3_wi_old*q0_vw_old) - q1_ic_old*(q0_wi_old*q2_vw_old + q2_wi_old*q0_vw_old + q1_wi_old*q3_vw_old - q3_wi_old*q1_vw_old) + q2_ic_old*(q0_wi_old*q1_vw_old + q1_wi_old*q0_vw_old - q2_wi_old*q3_vw_old + q3_wi_old*q2_vw_old) - q3_ic_old*(q1_wi_old*q1_vw_old - q0_wi_old*q0_vw_old + q2_wi_old*q2_vw_old + q3_wi_old*q3_vw_old))*(q0_ic_new*q1_vw_new + q1_ic_new*q0_vw_new + q2_ic_new*q3_vw_new - q3_ic_new*q2_vw_new),   (q0_ic_old*(q0_wi_old*q1_vw_old + q1_wi_old*q0_vw_old - q2_wi_old*q3_vw_old + q3_wi_old*q2_vw_old) - q1_ic_old*(q1_wi_old*q1_vw_old - q0_wi_old*q0_vw_old + q2_wi_old*q2_vw_old + q3_wi_old*q3_vw_old) - q2_ic_old*(q0_wi_old*q3_vw_old - q1_wi_old*q2_vw_old + q2_wi_old*q1_vw_old + q3_wi_old*q0_vw_old) + q3_ic_old*(q0_wi_old*q2_vw_old + q2_wi_old*q0_vw_old + q1_wi_old*q3_vw_old - q3_wi_old*q1_vw_old))*(q0_ic_new*q0_vw_new + q1_ic_new*q1_vw_new - q2_ic_new*q2_vw_new + q3_ic_new*q3_vw_new) - (q0_ic_old*(q1_wi_old*q1_vw_old - q0_wi_old*q0_vw_old + q2_wi_old*q2_vw_old + q3_wi_old*q3_vw_old) + q1_ic_old*(q0_wi_old*q1_vw_old + q1_wi_old*q0_vw_old - q2_wi_old*q3_vw_old + q3_wi_old*q2_vw_old) + q2_ic_old*(q0_wi_old*q2_vw_old + q2_wi_old*q0_vw_old + q1_wi_old*q3_vw_old - q3_wi_old*q1_vw_old) + q3_ic_old*(q0_wi_old*q3_vw_old - q1_wi_old*q2_vw_old + q2_wi_old*q1_vw_old + q3_wi_old*q0_vw_old))*(q1_ic_new*q0_vw_new - q0_ic_new*q1_vw_new + q2_ic_new*q3_vw_new + q3_ic_new*q2_vw_new) + (q0_ic_old*(q0_wi_old*q2_vw_old + q2_wi_old*q0_vw_old + q1_wi_old*q3_vw_old - q3_wi_old*q1_vw_old) + q1_ic_old*(q0_wi_old*q3_vw_old - q1_wi_old*q2_vw_old + q2_wi_old*q1_vw_old + q3_wi_old*q0_vw_old) - q2_ic_old*(q1_wi_old*q1_vw_old - q0_wi_old*q0_vw_old + q2_wi_old*q2_vw_old + q3_wi_old*q3_vw_old) - q3_ic_old*(q0_wi_old*q1_vw_old + q1_wi_old*q0_vw_old - q2_wi_old*q3_vw_old + q3_wi_old*q2_vw_old))*(q0_ic_new*q3_vw_new + q1_ic_new*q2_vw_new + q2_ic_new*q1_vw_new - q3_ic_new*q0_vw_new) - (q0_ic_old*(q0_wi_old*q3_vw_old - q1_wi_old*q2_vw_old + q2_wi_old*q1_vw_old + q3_wi_old*q0_vw_old) - q1_ic_old*(q0_wi_old*q2_vw_old + q2_wi_old*q0_vw_old + q1_wi_old*q3_vw_old - q3_wi_old*q1_vw_old) + q2_ic_old*(q0_wi_old*q1_vw_old + q1_wi_old*q0_vw_old - q2_wi_old*q3_vw_old + q3_wi_old*q2_vw_old) - q3_ic_old*(q1_wi_old*q1_vw_old - q0_wi_old*q0_vw_old + q2_wi_old*q2_vw_old + q3_wi_old*q3_vw_old))*(q0_ic_new*q2_vw_new + q2_ic_new*q0_vw_new - q1_ic_new*q3_vw_new + q3_ic_new*q1_vw_new),   (q0_ic_old*(q1_wi_old*q1_vw_old - q0_wi_old*q0_vw_old + q2_wi_old*q2_vw_old + q3_wi_old*q3_vw_old) + q1_ic_old*(q0_wi_old*q1_vw_old + q1_wi_old*q0_vw_old - q2_wi_old*q3_vw_old + q3_wi_old*q2_vw_old) + q2_ic_old*(q0_wi_old*q2_vw_old + q2_wi_old*q0_vw_old + q1_wi_old*q3_vw_old - q3_wi_old*q1_vw_old) + q3_ic_old*(q0_wi_old*q3_vw_old - q1_wi_old*q2_vw_old + q2_wi_old*q1_vw_old + q3_wi_old*q0_vw_old))*(q0_ic_new*q0_vw_new + q1_ic_new*q1_vw_new + q2_ic_new*q2_vw_new - q3_ic_new*q3_vw_new) - (q0_ic_old*(q0_wi_old*q1_vw_old + q1_wi_old*q0_vw_old - q2_wi_old*q3_vw_old + q3_wi_old*q2_vw_old) - q1_ic_old*(q1_wi_old*q1_vw_old - q0_wi_old*q0_vw_old + q2_wi_old*q2_vw_old + q3_wi_old*q3_vw_old) - q2_ic_old*(q0_wi_old*q3_vw_old - q1_wi_old*q2_vw_old + q2_wi_old*q1_vw_old + q3_wi_old*q0_vw_old) + q3_ic_old*(q0_wi_old*q2_vw_old + q2_wi_old*q0_vw_old + q1_wi_old*q3_vw_old - q3_wi_old*q1_vw_old))*(q0_ic_new*q1_vw_new - q1_ic_new*q0_vw_new + q2_ic_new*q3_vw_new + q3_ic_new*q2_vw_new) + (q0_ic_old*(q0_wi_old*q2_vw_old + q2_wi_old*q0_vw_old + q1_wi_old*q3_vw_old - q3_wi_old*q1_vw_old) + q1_ic_old*(q0_wi_old*q3_vw_old - q1_wi_old*q2_vw_old + q2_wi_old*q1_vw_old + q3_wi_old*q0_vw_old) - q2_ic_old*(q1_wi_old*q1_vw_old - q0_wi_old*q0_vw_old + q2_wi_old*q2_vw_old + q3_wi_old*q3_vw_old) - q3_ic_old*(q0_wi_old*q1_vw_old + q1_wi_old*q0_vw_old - q2_wi_old*q3_vw_old + q3_wi_old*q2_vw_old))*(q2_ic_new*q0_vw_new - q0_ic_new*q2_vw_new + q1_ic_new*q3_vw_new + q3_ic_new*q1_vw_new) - (q0_ic_old*(q0_wi_old*q3_vw_old - q1_wi_old*q2_vw_old + q2_wi_old*q1_vw_old + q3_wi_old*q0_vw_old) - q1_ic_old*(q0_wi_old*q2_vw_old + q2_wi_old*q0_vw_old + q1_wi_old*q3_vw_old - q3_wi_old*q1_vw_old) + q2_ic_old*(q0_wi_old*q1_vw_old + q1_wi_old*q0_vw_old - q2_wi_old*q3_vw_old + q3_wi_old*q2_vw_old) - q3_ic_old*(q1_wi_old*q1_vw_old - q0_wi_old*q0_vw_old + q2_wi_old*q2_vw_old + q3_wi_old*q3_vw_old))*(q0_ic_new*q3_vw_new + q1_ic_new*q2_vw_new - q2_ic_new*q1_vw_new + q3_ic_new*q0_vw_new)]];


% qH(k+m)(q_ic) = delta(z_q_relative) / delta(q_ic_k+m)
if (param.fusion.camFixQuatic == 0)
    H_z_q_relative_qic_new = [[ (q0_ic_old*(q1_wi_old*q1_vw_old - q0_wi_old*q0_vw_old + q2_wi_old*q2_vw_old + q3_wi_old*q3_vw_old) + q1_ic_old*(q0_wi_old*q1_vw_old + q1_wi_old*q0_vw_old - q2_wi_old*q3_vw_old + q3_wi_old*q2_vw_old) + q2_ic_old*(q0_wi_old*q2_vw_old + q2_wi_old*q0_vw_old + q1_wi_old*q3_vw_old - q3_wi_old*q1_vw_old) + q3_ic_old*(q0_wi_old*q3_vw_old - q1_wi_old*q2_vw_old + q2_wi_old*q1_vw_old + q3_wi_old*q0_vw_old))*(q1_wi_new*q1_vw_new - q0_wi_new*q0_vw_new + q2_wi_new*q2_vw_new + q3_wi_new*q3_vw_new) + (q0_ic_old*(q0_wi_old*q1_vw_old + q1_wi_old*q0_vw_old - q2_wi_old*q3_vw_old + q3_wi_old*q2_vw_old) - q1_ic_old*(q1_wi_old*q1_vw_old - q0_wi_old*q0_vw_old + q2_wi_old*q2_vw_old + q3_wi_old*q3_vw_old) - q2_ic_old*(q0_wi_old*q3_vw_old - q1_wi_old*q2_vw_old + q2_wi_old*q1_vw_old + q3_wi_old*q0_vw_old) + q3_ic_old*(q0_wi_old*q2_vw_old + q2_wi_old*q0_vw_old + q1_wi_old*q3_vw_old - q3_wi_old*q1_vw_old))*(q0_wi_new*q1_vw_new + q1_wi_new*q0_vw_new - q2_wi_new*q3_vw_new + q3_wi_new*q2_vw_new) + (q0_ic_old*(q0_wi_old*q2_vw_old + q2_wi_old*q0_vw_old + q1_wi_old*q3_vw_old - q3_wi_old*q1_vw_old) + q1_ic_old*(q0_wi_old*q3_vw_old - q1_wi_old*q2_vw_old + q2_wi_old*q1_vw_old + q3_wi_old*q0_vw_old) - q2_ic_old*(q1_wi_old*q1_vw_old - q0_wi_old*q0_vw_old + q2_wi_old*q2_vw_old + q3_wi_old*q3_vw_old) - q3_ic_old*(q0_wi_old*q1_vw_old + q1_wi_old*q0_vw_old - q2_wi_old*q3_vw_old + q3_wi_old*q2_vw_old))*(q0_wi_new*q2_vw_new + q2_wi_new*q0_vw_new + q1_wi_new*q3_vw_new - q3_wi_new*q1_vw_new) + (q0_ic_old*(q0_wi_old*q3_vw_old - q1_wi_old*q2_vw_old + q2_wi_old*q1_vw_old + q3_wi_old*q0_vw_old) - q1_ic_old*(q0_wi_old*q2_vw_old + q2_wi_old*q0_vw_old + q1_wi_old*q3_vw_old - q3_wi_old*q1_vw_old) + q2_ic_old*(q0_wi_old*q1_vw_old + q1_wi_old*q0_vw_old - q2_wi_old*q3_vw_old + q3_wi_old*q2_vw_old) - q3_ic_old*(q1_wi_old*q1_vw_old - q0_wi_old*q0_vw_old + q2_wi_old*q2_vw_old + q3_wi_old*q3_vw_old))*(q0_wi_new*q3_vw_new - q1_wi_new*q2_vw_new + q2_wi_new*q1_vw_new + q3_wi_new*q0_vw_new),   (q0_ic_old*(q1_wi_old*q1_vw_old - q0_wi_old*q0_vw_old + q2_wi_old*q2_vw_old + q3_wi_old*q3_vw_old) + q1_ic_old*(q0_wi_old*q1_vw_old + q1_wi_old*q0_vw_old - q2_wi_old*q3_vw_old + q3_wi_old*q2_vw_old) + q2_ic_old*(q0_wi_old*q2_vw_old + q2_wi_old*q0_vw_old + q1_wi_old*q3_vw_old - q3_wi_old*q1_vw_old) + q3_ic_old*(q0_wi_old*q3_vw_old - q1_wi_old*q2_vw_old + q2_wi_old*q1_vw_old + q3_wi_old*q0_vw_old))*(q0_wi_new*q1_vw_new + q1_wi_new*q0_vw_new - q2_wi_new*q3_vw_new + q3_wi_new*q2_vw_new) - (q0_ic_old*(q0_wi_old*q1_vw_old + q1_wi_old*q0_vw_old - q2_wi_old*q3_vw_old + q3_wi_old*q2_vw_old) - q1_ic_old*(q1_wi_old*q1_vw_old - q0_wi_old*q0_vw_old + q2_wi_old*q2_vw_old + q3_wi_old*q3_vw_old) - q2_ic_old*(q0_wi_old*q3_vw_old - q1_wi_old*q2_vw_old + q2_wi_old*q1_vw_old + q3_wi_old*q0_vw_old) + q3_ic_old*(q0_wi_old*q2_vw_old + q2_wi_old*q0_vw_old + q1_wi_old*q3_vw_old - q3_wi_old*q1_vw_old))*(q1_wi_new*q1_vw_new - q0_wi_new*q0_vw_new + q2_wi_new*q2_vw_new + q3_wi_new*q3_vw_new) + (q0_ic_old*(q0_wi_old*q2_vw_old + q2_wi_old*q0_vw_old + q1_wi_old*q3_vw_old - q3_wi_old*q1_vw_old) + q1_ic_old*(q0_wi_old*q3_vw_old - q1_wi_old*q2_vw_old + q2_wi_old*q1_vw_old + q3_wi_old*q0_vw_old) - q2_ic_old*(q1_wi_old*q1_vw_old - q0_wi_old*q0_vw_old + q2_wi_old*q2_vw_old + q3_wi_old*q3_vw_old) - q3_ic_old*(q0_wi_old*q1_vw_old + q1_wi_old*q0_vw_old - q2_wi_old*q3_vw_old + q3_wi_old*q2_vw_old))*(q0_wi_new*q3_vw_new - q1_wi_new*q2_vw_new + q2_wi_new*q1_vw_new + q3_wi_new*q0_vw_new) - (q0_ic_old*(q0_wi_old*q3_vw_old - q1_wi_old*q2_vw_old + q2_wi_old*q1_vw_old + q3_wi_old*q0_vw_old) - q1_ic_old*(q0_wi_old*q2_vw_old + q2_wi_old*q0_vw_old + q1_wi_old*q3_vw_old - q3_wi_old*q1_vw_old) + q2_ic_old*(q0_wi_old*q1_vw_old + q1_wi_old*q0_vw_old - q2_wi_old*q3_vw_old + q3_wi_old*q2_vw_old) - q3_ic_old*(q1_wi_old*q1_vw_old - q0_wi_old*q0_vw_old + q2_wi_old*q2_vw_old + q3_wi_old*q3_vw_old))*(q0_wi_new*q2_vw_new + q2_wi_new*q0_vw_new + q1_wi_new*q3_vw_new - q3_wi_new*q1_vw_new),   (q0_ic_old*(q1_wi_old*q1_vw_old - q0_wi_old*q0_vw_old + q2_wi_old*q2_vw_old + q3_wi_old*q3_vw_old) + q1_ic_old*(q0_wi_old*q1_vw_old + q1_wi_old*q0_vw_old - q2_wi_old*q3_vw_old + q3_wi_old*q2_vw_old) + q2_ic_old*(q0_wi_old*q2_vw_old + q2_wi_old*q0_vw_old + q1_wi_old*q3_vw_old - q3_wi_old*q1_vw_old) + q3_ic_old*(q0_wi_old*q3_vw_old - q1_wi_old*q2_vw_old + q2_wi_old*q1_vw_old + q3_wi_old*q0_vw_old))*(q0_wi_new*q2_vw_new + q2_wi_new*q0_vw_new + q1_wi_new*q3_vw_new - q3_wi_new*q1_vw_new) - (q0_ic_old*(q0_wi_old*q1_vw_old + q1_wi_old*q0_vw_old - q2_wi_old*q3_vw_old + q3_wi_old*q2_vw_old) - q1_ic_old*(q1_wi_old*q1_vw_old - q0_wi_old*q0_vw_old + q2_wi_old*q2_vw_old + q3_wi_old*q3_vw_old) - q2_ic_old*(q0_wi_old*q3_vw_old - q1_wi_old*q2_vw_old + q2_wi_old*q1_vw_old + q3_wi_old*q0_vw_old) + q3_ic_old*(q0_wi_old*q2_vw_old + q2_wi_old*q0_vw_old + q1_wi_old*q3_vw_old - q3_wi_old*q1_vw_old))*(q0_wi_new*q3_vw_new - q1_wi_new*q2_vw_new + q2_wi_new*q1_vw_new + q3_wi_new*q0_vw_new) - (q0_ic_old*(q0_wi_old*q2_vw_old + q2_wi_old*q0_vw_old + q1_wi_old*q3_vw_old - q3_wi_old*q1_vw_old) + q1_ic_old*(q0_wi_old*q3_vw_old - q1_wi_old*q2_vw_old + q2_wi_old*q1_vw_old + q3_wi_old*q0_vw_old) - q2_ic_old*(q1_wi_old*q1_vw_old - q0_wi_old*q0_vw_old + q2_wi_old*q2_vw_old + q3_wi_old*q3_vw_old) - q3_ic_old*(q0_wi_old*q1_vw_old + q1_wi_old*q0_vw_old - q2_wi_old*q3_vw_old + q3_wi_old*q2_vw_old))*(q1_wi_new*q1_vw_new - q0_wi_new*q0_vw_new + q2_wi_new*q2_vw_new + q3_wi_new*q3_vw_new) + (q0_ic_old*(q0_wi_old*q3_vw_old - q1_wi_old*q2_vw_old + q2_wi_old*q1_vw_old + q3_wi_old*q0_vw_old) - q1_ic_old*(q0_wi_old*q2_vw_old + q2_wi_old*q0_vw_old + q1_wi_old*q3_vw_old - q3_wi_old*q1_vw_old) + q2_ic_old*(q0_wi_old*q1_vw_old + q1_wi_old*q0_vw_old - q2_wi_old*q3_vw_old + q3_wi_old*q2_vw_old) - q3_ic_old*(q1_wi_old*q1_vw_old - q0_wi_old*q0_vw_old + q2_wi_old*q2_vw_old + q3_wi_old*q3_vw_old))*(q0_wi_new*q1_vw_new + q1_wi_new*q0_vw_new - q2_wi_new*q3_vw_new + q3_wi_new*q2_vw_new),   (q0_ic_old*(q1_wi_old*q1_vw_old - q0_wi_old*q0_vw_old + q2_wi_old*q2_vw_old + q3_wi_old*q3_vw_old) + q1_ic_old*(q0_wi_old*q1_vw_old + q1_wi_old*q0_vw_old - q2_wi_old*q3_vw_old + q3_wi_old*q2_vw_old) + q2_ic_old*(q0_wi_old*q2_vw_old + q2_wi_old*q0_vw_old + q1_wi_old*q3_vw_old - q3_wi_old*q1_vw_old) + q3_ic_old*(q0_wi_old*q3_vw_old - q1_wi_old*q2_vw_old + q2_wi_old*q1_vw_old + q3_wi_old*q0_vw_old))*(q0_wi_new*q3_vw_new - q1_wi_new*q2_vw_new + q2_wi_new*q1_vw_new + q3_wi_new*q0_vw_new) + (q0_ic_old*(q0_wi_old*q1_vw_old + q1_wi_old*q0_vw_old - q2_wi_old*q3_vw_old + q3_wi_old*q2_vw_old) - q1_ic_old*(q1_wi_old*q1_vw_old - q0_wi_old*q0_vw_old + q2_wi_old*q2_vw_old + q3_wi_old*q3_vw_old) - q2_ic_old*(q0_wi_old*q3_vw_old - q1_wi_old*q2_vw_old + q2_wi_old*q1_vw_old + q3_wi_old*q0_vw_old) + q3_ic_old*(q0_wi_old*q2_vw_old + q2_wi_old*q0_vw_old + q1_wi_old*q3_vw_old - q3_wi_old*q1_vw_old))*(q0_wi_new*q2_vw_new + q2_wi_new*q0_vw_new + q1_wi_new*q3_vw_new - q3_wi_new*q1_vw_new) - (q0_ic_old*(q0_wi_old*q2_vw_old + q2_wi_old*q0_vw_old + q1_wi_old*q3_vw_old - q3_wi_old*q1_vw_old) + q1_ic_old*(q0_wi_old*q3_vw_old - q1_wi_old*q2_vw_old + q2_wi_old*q1_vw_old + q3_wi_old*q0_vw_old) - q2_ic_old*(q1_wi_old*q1_vw_old - q0_wi_old*q0_vw_old + q2_wi_old*q2_vw_old + q3_wi_old*q3_vw_old) - q3_ic_old*(q0_wi_old*q1_vw_old + q1_wi_old*q0_vw_old - q2_wi_old*q3_vw_old + q3_wi_old*q2_vw_old))*(q0_wi_new*q1_vw_new + q1_wi_new*q0_vw_new - q2_wi_new*q3_vw_new + q3_wi_new*q2_vw_new) - (q0_ic_old*(q0_wi_old*q3_vw_old - q1_wi_old*q2_vw_old + q2_wi_old*q1_vw_old + q3_wi_old*q0_vw_old) - q1_ic_old*(q0_wi_old*q2_vw_old + q2_wi_old*q0_vw_old + q1_wi_old*q3_vw_old - q3_wi_old*q1_vw_old) + q2_ic_old*(q0_wi_old*q1_vw_old + q1_wi_old*q0_vw_old - q2_wi_old*q3_vw_old + q3_wi_old*q2_vw_old) - q3_ic_old*(q1_wi_old*q1_vw_old - q0_wi_old*q0_vw_old + q2_wi_old*q2_vw_old + q3_wi_old*q3_vw_old))*(q1_wi_new*q1_vw_new - q0_wi_new*q0_vw_new + q2_wi_new*q2_vw_new + q3_wi_new*q3_vw_new)]
                              [ (q0_ic_old*(q1_wi_old*q1_vw_old - q0_wi_old*q0_vw_old + q2_wi_old*q2_vw_old + q3_wi_old*q3_vw_old) + q1_ic_old*(q0_wi_old*q1_vw_old + q1_wi_old*q0_vw_old - q2_wi_old*q3_vw_old + q3_wi_old*q2_vw_old) + q2_ic_old*(q0_wi_old*q2_vw_old + q2_wi_old*q0_vw_old + q1_wi_old*q3_vw_old - q3_wi_old*q1_vw_old) + q3_ic_old*(q0_wi_old*q3_vw_old - q1_wi_old*q2_vw_old + q2_wi_old*q1_vw_old + q3_wi_old*q0_vw_old))*(q0_wi_new*q1_vw_new + q1_wi_new*q0_vw_new - q2_wi_new*q3_vw_new + q3_wi_new*q2_vw_new) - (q0_ic_old*(q0_wi_old*q1_vw_old + q1_wi_old*q0_vw_old - q2_wi_old*q3_vw_old + q3_wi_old*q2_vw_old) - q1_ic_old*(q1_wi_old*q1_vw_old - q0_wi_old*q0_vw_old + q2_wi_old*q2_vw_old + q3_wi_old*q3_vw_old) - q2_ic_old*(q0_wi_old*q3_vw_old - q1_wi_old*q2_vw_old + q2_wi_old*q1_vw_old + q3_wi_old*q0_vw_old) + q3_ic_old*(q0_wi_old*q2_vw_old + q2_wi_old*q0_vw_old + q1_wi_old*q3_vw_old - q3_wi_old*q1_vw_old))*(q1_wi_new*q1_vw_new - q0_wi_new*q0_vw_new + q2_wi_new*q2_vw_new + q3_wi_new*q3_vw_new) + (q0_ic_old*(q0_wi_old*q2_vw_old + q2_wi_old*q0_vw_old + q1_wi_old*q3_vw_old - q3_wi_old*q1_vw_old) + q1_ic_old*(q0_wi_old*q3_vw_old - q1_wi_old*q2_vw_old + q2_wi_old*q1_vw_old + q3_wi_old*q0_vw_old) - q2_ic_old*(q1_wi_old*q1_vw_old - q0_wi_old*q0_vw_old + q2_wi_old*q2_vw_old + q3_wi_old*q3_vw_old) - q3_ic_old*(q0_wi_old*q1_vw_old + q1_wi_old*q0_vw_old - q2_wi_old*q3_vw_old + q3_wi_old*q2_vw_old))*(q0_wi_new*q3_vw_new - q1_wi_new*q2_vw_new + q2_wi_new*q1_vw_new + q3_wi_new*q0_vw_new) - (q0_ic_old*(q0_wi_old*q3_vw_old - q1_wi_old*q2_vw_old + q2_wi_old*q1_vw_old + q3_wi_old*q0_vw_old) - q1_ic_old*(q0_wi_old*q2_vw_old + q2_wi_old*q0_vw_old + q1_wi_old*q3_vw_old - q3_wi_old*q1_vw_old) + q2_ic_old*(q0_wi_old*q1_vw_old + q1_wi_old*q0_vw_old - q2_wi_old*q3_vw_old + q3_wi_old*q2_vw_old) - q3_ic_old*(q1_wi_old*q1_vw_old - q0_wi_old*q0_vw_old + q2_wi_old*q2_vw_old + q3_wi_old*q3_vw_old))*(q0_wi_new*q2_vw_new + q2_wi_new*q0_vw_new + q1_wi_new*q3_vw_new - q3_wi_new*q1_vw_new), - (q0_ic_old*(q1_wi_old*q1_vw_old - q0_wi_old*q0_vw_old + q2_wi_old*q2_vw_old + q3_wi_old*q3_vw_old) + q1_ic_old*(q0_wi_old*q1_vw_old + q1_wi_old*q0_vw_old - q2_wi_old*q3_vw_old + q3_wi_old*q2_vw_old) + q2_ic_old*(q0_wi_old*q2_vw_old + q2_wi_old*q0_vw_old + q1_wi_old*q3_vw_old - q3_wi_old*q1_vw_old) + q3_ic_old*(q0_wi_old*q3_vw_old - q1_wi_old*q2_vw_old + q2_wi_old*q1_vw_old + q3_wi_old*q0_vw_old))*(q1_wi_new*q1_vw_new - q0_wi_new*q0_vw_new + q2_wi_new*q2_vw_new + q3_wi_new*q3_vw_new) - (q0_ic_old*(q0_wi_old*q1_vw_old + q1_wi_old*q0_vw_old - q2_wi_old*q3_vw_old + q3_wi_old*q2_vw_old) - q1_ic_old*(q1_wi_old*q1_vw_old - q0_wi_old*q0_vw_old + q2_wi_old*q2_vw_old + q3_wi_old*q3_vw_old) - q2_ic_old*(q0_wi_old*q3_vw_old - q1_wi_old*q2_vw_old + q2_wi_old*q1_vw_old + q3_wi_old*q0_vw_old) + q3_ic_old*(q0_wi_old*q2_vw_old + q2_wi_old*q0_vw_old + q1_wi_old*q3_vw_old - q3_wi_old*q1_vw_old))*(q0_wi_new*q1_vw_new + q1_wi_new*q0_vw_new - q2_wi_new*q3_vw_new + q3_wi_new*q2_vw_new) - (q0_ic_old*(q0_wi_old*q2_vw_old + q2_wi_old*q0_vw_old + q1_wi_old*q3_vw_old - q3_wi_old*q1_vw_old) + q1_ic_old*(q0_wi_old*q3_vw_old - q1_wi_old*q2_vw_old + q2_wi_old*q1_vw_old + q3_wi_old*q0_vw_old) - q2_ic_old*(q1_wi_old*q1_vw_old - q0_wi_old*q0_vw_old + q2_wi_old*q2_vw_old + q3_wi_old*q3_vw_old) - q3_ic_old*(q0_wi_old*q1_vw_old + q1_wi_old*q0_vw_old - q2_wi_old*q3_vw_old + q3_wi_old*q2_vw_old))*(q0_wi_new*q2_vw_new + q2_wi_new*q0_vw_new + q1_wi_new*q3_vw_new - q3_wi_new*q1_vw_new) - (q0_ic_old*(q0_wi_old*q3_vw_old - q1_wi_old*q2_vw_old + q2_wi_old*q1_vw_old + q3_wi_old*q0_vw_old) - q1_ic_old*(q0_wi_old*q2_vw_old + q2_wi_old*q0_vw_old + q1_wi_old*q3_vw_old - q3_wi_old*q1_vw_old) + q2_ic_old*(q0_wi_old*q1_vw_old + q1_wi_old*q0_vw_old - q2_wi_old*q3_vw_old + q3_wi_old*q2_vw_old) - q3_ic_old*(q1_wi_old*q1_vw_old - q0_wi_old*q0_vw_old + q2_wi_old*q2_vw_old + q3_wi_old*q3_vw_old))*(q0_wi_new*q3_vw_new - q1_wi_new*q2_vw_new + q2_wi_new*q1_vw_new + q3_wi_new*q0_vw_new),   (q0_ic_old*(q0_wi_old*q2_vw_old + q2_wi_old*q0_vw_old + q1_wi_old*q3_vw_old - q3_wi_old*q1_vw_old) + q1_ic_old*(q0_wi_old*q3_vw_old - q1_wi_old*q2_vw_old + q2_wi_old*q1_vw_old + q3_wi_old*q0_vw_old) - q2_ic_old*(q1_wi_old*q1_vw_old - q0_wi_old*q0_vw_old + q2_wi_old*q2_vw_old + q3_wi_old*q3_vw_old) - q3_ic_old*(q0_wi_old*q1_vw_old + q1_wi_old*q0_vw_old - q2_wi_old*q3_vw_old + q3_wi_old*q2_vw_old))*(q0_wi_new*q1_vw_new + q1_wi_new*q0_vw_new - q2_wi_new*q3_vw_new + q3_wi_new*q2_vw_new) - (q0_ic_old*(q0_wi_old*q1_vw_old + q1_wi_old*q0_vw_old - q2_wi_old*q3_vw_old + q3_wi_old*q2_vw_old) - q1_ic_old*(q1_wi_old*q1_vw_old - q0_wi_old*q0_vw_old + q2_wi_old*q2_vw_old + q3_wi_old*q3_vw_old) - q2_ic_old*(q0_wi_old*q3_vw_old - q1_wi_old*q2_vw_old + q2_wi_old*q1_vw_old + q3_wi_old*q0_vw_old) + q3_ic_old*(q0_wi_old*q2_vw_old + q2_wi_old*q0_vw_old + q1_wi_old*q3_vw_old - q3_wi_old*q1_vw_old))*(q0_wi_new*q2_vw_new + q2_wi_new*q0_vw_new + q1_wi_new*q3_vw_new - q3_wi_new*q1_vw_new) - (q0_ic_old*(q1_wi_old*q1_vw_old - q0_wi_old*q0_vw_old + q2_wi_old*q2_vw_old + q3_wi_old*q3_vw_old) + q1_ic_old*(q0_wi_old*q1_vw_old + q1_wi_old*q0_vw_old - q2_wi_old*q3_vw_old + q3_wi_old*q2_vw_old) + q2_ic_old*(q0_wi_old*q2_vw_old + q2_wi_old*q0_vw_old + q1_wi_old*q3_vw_old - q3_wi_old*q1_vw_old) + q3_ic_old*(q0_wi_old*q3_vw_old - q1_wi_old*q2_vw_old + q2_wi_old*q1_vw_old + q3_wi_old*q0_vw_old))*(q0_wi_new*q3_vw_new - q1_wi_new*q2_vw_new + q2_wi_new*q1_vw_new + q3_wi_new*q0_vw_new) + (q0_ic_old*(q0_wi_old*q3_vw_old - q1_wi_old*q2_vw_old + q2_wi_old*q1_vw_old + q3_wi_old*q0_vw_old) - q1_ic_old*(q0_wi_old*q2_vw_old + q2_wi_old*q0_vw_old + q1_wi_old*q3_vw_old - q3_wi_old*q1_vw_old) + q2_ic_old*(q0_wi_old*q1_vw_old + q1_wi_old*q0_vw_old - q2_wi_old*q3_vw_old + q3_wi_old*q2_vw_old) - q3_ic_old*(q1_wi_old*q1_vw_old - q0_wi_old*q0_vw_old + q2_wi_old*q2_vw_old + q3_wi_old*q3_vw_old))*(q1_wi_new*q1_vw_new - q0_wi_new*q0_vw_new + q2_wi_new*q2_vw_new + q3_wi_new*q3_vw_new),   (q0_ic_old*(q1_wi_old*q1_vw_old - q0_wi_old*q0_vw_old + q2_wi_old*q2_vw_old + q3_wi_old*q3_vw_old) + q1_ic_old*(q0_wi_old*q1_vw_old + q1_wi_old*q0_vw_old - q2_wi_old*q3_vw_old + q3_wi_old*q2_vw_old) + q2_ic_old*(q0_wi_old*q2_vw_old + q2_wi_old*q0_vw_old + q1_wi_old*q3_vw_old - q3_wi_old*q1_vw_old) + q3_ic_old*(q0_wi_old*q3_vw_old - q1_wi_old*q2_vw_old + q2_wi_old*q1_vw_old + q3_wi_old*q0_vw_old))*(q0_wi_new*q2_vw_new + q2_wi_new*q0_vw_new + q1_wi_new*q3_vw_new - q3_wi_new*q1_vw_new) - (q0_ic_old*(q0_wi_old*q1_vw_old + q1_wi_old*q0_vw_old - q2_wi_old*q3_vw_old + q3_wi_old*q2_vw_old) - q1_ic_old*(q1_wi_old*q1_vw_old - q0_wi_old*q0_vw_old + q2_wi_old*q2_vw_old + q3_wi_old*q3_vw_old) - q2_ic_old*(q0_wi_old*q3_vw_old - q1_wi_old*q2_vw_old + q2_wi_old*q1_vw_old + q3_wi_old*q0_vw_old) + q3_ic_old*(q0_wi_old*q2_vw_old + q2_wi_old*q0_vw_old + q1_wi_old*q3_vw_old - q3_wi_old*q1_vw_old))*(q0_wi_new*q3_vw_new - q1_wi_new*q2_vw_new + q2_wi_new*q1_vw_new + q3_wi_new*q0_vw_new) - (q0_ic_old*(q0_wi_old*q2_vw_old + q2_wi_old*q0_vw_old + q1_wi_old*q3_vw_old - q3_wi_old*q1_vw_old) + q1_ic_old*(q0_wi_old*q3_vw_old - q1_wi_old*q2_vw_old + q2_wi_old*q1_vw_old + q3_wi_old*q0_vw_old) - q2_ic_old*(q1_wi_old*q1_vw_old - q0_wi_old*q0_vw_old + q2_wi_old*q2_vw_old + q3_wi_old*q3_vw_old) - q3_ic_old*(q0_wi_old*q1_vw_old + q1_wi_old*q0_vw_old - q2_wi_old*q3_vw_old + q3_wi_old*q2_vw_old))*(q1_wi_new*q1_vw_new - q0_wi_new*q0_vw_new + q2_wi_new*q2_vw_new + q3_wi_new*q3_vw_new) + (q0_ic_old*(q0_wi_old*q3_vw_old - q1_wi_old*q2_vw_old + q2_wi_old*q1_vw_old + q3_wi_old*q0_vw_old) - q1_ic_old*(q0_wi_old*q2_vw_old + q2_wi_old*q0_vw_old + q1_wi_old*q3_vw_old - q3_wi_old*q1_vw_old) + q2_ic_old*(q0_wi_old*q1_vw_old + q1_wi_old*q0_vw_old - q2_wi_old*q3_vw_old + q3_wi_old*q2_vw_old) - q3_ic_old*(q1_wi_old*q1_vw_old - q0_wi_old*q0_vw_old + q2_wi_old*q2_vw_old + q3_wi_old*q3_vw_old))*(q0_wi_new*q1_vw_new + q1_wi_new*q0_vw_new - q2_wi_new*q3_vw_new + q3_wi_new*q2_vw_new)]
                              [ (q0_ic_old*(q1_wi_old*q1_vw_old - q0_wi_old*q0_vw_old + q2_wi_old*q2_vw_old + q3_wi_old*q3_vw_old) + q1_ic_old*(q0_wi_old*q1_vw_old + q1_wi_old*q0_vw_old - q2_wi_old*q3_vw_old + q3_wi_old*q2_vw_old) + q2_ic_old*(q0_wi_old*q2_vw_old + q2_wi_old*q0_vw_old + q1_wi_old*q3_vw_old - q3_wi_old*q1_vw_old) + q3_ic_old*(q0_wi_old*q3_vw_old - q1_wi_old*q2_vw_old + q2_wi_old*q1_vw_old + q3_wi_old*q0_vw_old))*(q0_wi_new*q2_vw_new + q2_wi_new*q0_vw_new + q1_wi_new*q3_vw_new - q3_wi_new*q1_vw_new) - (q0_ic_old*(q0_wi_old*q1_vw_old + q1_wi_old*q0_vw_old - q2_wi_old*q3_vw_old + q3_wi_old*q2_vw_old) - q1_ic_old*(q1_wi_old*q1_vw_old - q0_wi_old*q0_vw_old + q2_wi_old*q2_vw_old + q3_wi_old*q3_vw_old) - q2_ic_old*(q0_wi_old*q3_vw_old - q1_wi_old*q2_vw_old + q2_wi_old*q1_vw_old + q3_wi_old*q0_vw_old) + q3_ic_old*(q0_wi_old*q2_vw_old + q2_wi_old*q0_vw_old + q1_wi_old*q3_vw_old - q3_wi_old*q1_vw_old))*(q0_wi_new*q3_vw_new - q1_wi_new*q2_vw_new + q2_wi_new*q1_vw_new + q3_wi_new*q0_vw_new) - (q0_ic_old*(q0_wi_old*q2_vw_old + q2_wi_old*q0_vw_old + q1_wi_old*q3_vw_old - q3_wi_old*q1_vw_old) + q1_ic_old*(q0_wi_old*q3_vw_old - q1_wi_old*q2_vw_old + q2_wi_old*q1_vw_old + q3_wi_old*q0_vw_old) - q2_ic_old*(q1_wi_old*q1_vw_old - q0_wi_old*q0_vw_old + q2_wi_old*q2_vw_old + q3_wi_old*q3_vw_old) - q3_ic_old*(q0_wi_old*q1_vw_old + q1_wi_old*q0_vw_old - q2_wi_old*q3_vw_old + q3_wi_old*q2_vw_old))*(q1_wi_new*q1_vw_new - q0_wi_new*q0_vw_new + q2_wi_new*q2_vw_new + q3_wi_new*q3_vw_new) + (q0_ic_old*(q0_wi_old*q3_vw_old - q1_wi_old*q2_vw_old + q2_wi_old*q1_vw_old + q3_wi_old*q0_vw_old) - q1_ic_old*(q0_wi_old*q2_vw_old + q2_wi_old*q0_vw_old + q1_wi_old*q3_vw_old - q3_wi_old*q1_vw_old) + q2_ic_old*(q0_wi_old*q1_vw_old + q1_wi_old*q0_vw_old - q2_wi_old*q3_vw_old + q3_wi_old*q2_vw_old) - q3_ic_old*(q1_wi_old*q1_vw_old - q0_wi_old*q0_vw_old + q2_wi_old*q2_vw_old + q3_wi_old*q3_vw_old))*(q0_wi_new*q1_vw_new + q1_wi_new*q0_vw_new - q2_wi_new*q3_vw_new + q3_wi_new*q2_vw_new),   (q0_ic_old*(q1_wi_old*q1_vw_old - q0_wi_old*q0_vw_old + q2_wi_old*q2_vw_old + q3_wi_old*q3_vw_old) + q1_ic_old*(q0_wi_old*q1_vw_old + q1_wi_old*q0_vw_old - q2_wi_old*q3_vw_old + q3_wi_old*q2_vw_old) + q2_ic_old*(q0_wi_old*q2_vw_old + q2_wi_old*q0_vw_old + q1_wi_old*q3_vw_old - q3_wi_old*q1_vw_old) + q3_ic_old*(q0_wi_old*q3_vw_old - q1_wi_old*q2_vw_old + q2_wi_old*q1_vw_old + q3_wi_old*q0_vw_old))*(q0_wi_new*q3_vw_new - q1_wi_new*q2_vw_new + q2_wi_new*q1_vw_new + q3_wi_new*q0_vw_new) + (q0_ic_old*(q0_wi_old*q1_vw_old + q1_wi_old*q0_vw_old - q2_wi_old*q3_vw_old + q3_wi_old*q2_vw_old) - q1_ic_old*(q1_wi_old*q1_vw_old - q0_wi_old*q0_vw_old + q2_wi_old*q2_vw_old + q3_wi_old*q3_vw_old) - q2_ic_old*(q0_wi_old*q3_vw_old - q1_wi_old*q2_vw_old + q2_wi_old*q1_vw_old + q3_wi_old*q0_vw_old) + q3_ic_old*(q0_wi_old*q2_vw_old + q2_wi_old*q0_vw_old + q1_wi_old*q3_vw_old - q3_wi_old*q1_vw_old))*(q0_wi_new*q2_vw_new + q2_wi_new*q0_vw_new + q1_wi_new*q3_vw_new - q3_wi_new*q1_vw_new) - (q0_ic_old*(q0_wi_old*q2_vw_old + q2_wi_old*q0_vw_old + q1_wi_old*q3_vw_old - q3_wi_old*q1_vw_old) + q1_ic_old*(q0_wi_old*q3_vw_old - q1_wi_old*q2_vw_old + q2_wi_old*q1_vw_old + q3_wi_old*q0_vw_old) - q2_ic_old*(q1_wi_old*q1_vw_old - q0_wi_old*q0_vw_old + q2_wi_old*q2_vw_old + q3_wi_old*q3_vw_old) - q3_ic_old*(q0_wi_old*q1_vw_old + q1_wi_old*q0_vw_old - q2_wi_old*q3_vw_old + q3_wi_old*q2_vw_old))*(q0_wi_new*q1_vw_new + q1_wi_new*q0_vw_new - q2_wi_new*q3_vw_new + q3_wi_new*q2_vw_new) - (q0_ic_old*(q0_wi_old*q3_vw_old - q1_wi_old*q2_vw_old + q2_wi_old*q1_vw_old + q3_wi_old*q0_vw_old) - q1_ic_old*(q0_wi_old*q2_vw_old + q2_wi_old*q0_vw_old + q1_wi_old*q3_vw_old - q3_wi_old*q1_vw_old) + q2_ic_old*(q0_wi_old*q1_vw_old + q1_wi_old*q0_vw_old - q2_wi_old*q3_vw_old + q3_wi_old*q2_vw_old) - q3_ic_old*(q1_wi_old*q1_vw_old - q0_wi_old*q0_vw_old + q2_wi_old*q2_vw_old + q3_wi_old*q3_vw_old))*(q1_wi_new*q1_vw_new - q0_wi_new*q0_vw_new + q2_wi_new*q2_vw_new + q3_wi_new*q3_vw_new), - (q0_ic_old*(q1_wi_old*q1_vw_old - q0_wi_old*q0_vw_old + q2_wi_old*q2_vw_old + q3_wi_old*q3_vw_old) + q1_ic_old*(q0_wi_old*q1_vw_old + q1_wi_old*q0_vw_old - q2_wi_old*q3_vw_old + q3_wi_old*q2_vw_old) + q2_ic_old*(q0_wi_old*q2_vw_old + q2_wi_old*q0_vw_old + q1_wi_old*q3_vw_old - q3_wi_old*q1_vw_old) + q3_ic_old*(q0_wi_old*q3_vw_old - q1_wi_old*q2_vw_old + q2_wi_old*q1_vw_old + q3_wi_old*q0_vw_old))*(q1_wi_new*q1_vw_new - q0_wi_new*q0_vw_new + q2_wi_new*q2_vw_new + q3_wi_new*q3_vw_new) - (q0_ic_old*(q0_wi_old*q1_vw_old + q1_wi_old*q0_vw_old - q2_wi_old*q3_vw_old + q3_wi_old*q2_vw_old) - q1_ic_old*(q1_wi_old*q1_vw_old - q0_wi_old*q0_vw_old + q2_wi_old*q2_vw_old + q3_wi_old*q3_vw_old) - q2_ic_old*(q0_wi_old*q3_vw_old - q1_wi_old*q2_vw_old + q2_wi_old*q1_vw_old + q3_wi_old*q0_vw_old) + q3_ic_old*(q0_wi_old*q2_vw_old + q2_wi_old*q0_vw_old + q1_wi_old*q3_vw_old - q3_wi_old*q1_vw_old))*(q0_wi_new*q1_vw_new + q1_wi_new*q0_vw_new - q2_wi_new*q3_vw_new + q3_wi_new*q2_vw_new) - (q0_ic_old*(q0_wi_old*q2_vw_old + q2_wi_old*q0_vw_old + q1_wi_old*q3_vw_old - q3_wi_old*q1_vw_old) + q1_ic_old*(q0_wi_old*q3_vw_old - q1_wi_old*q2_vw_old + q2_wi_old*q1_vw_old + q3_wi_old*q0_vw_old) - q2_ic_old*(q1_wi_old*q1_vw_old - q0_wi_old*q0_vw_old + q2_wi_old*q2_vw_old + q3_wi_old*q3_vw_old) - q3_ic_old*(q0_wi_old*q1_vw_old + q1_wi_old*q0_vw_old - q2_wi_old*q3_vw_old + q3_wi_old*q2_vw_old))*(q0_wi_new*q2_vw_new + q2_wi_new*q0_vw_new + q1_wi_new*q3_vw_new - q3_wi_new*q1_vw_new) - (q0_ic_old*(q0_wi_old*q3_vw_old - q1_wi_old*q2_vw_old + q2_wi_old*q1_vw_old + q3_wi_old*q0_vw_old) - q1_ic_old*(q0_wi_old*q2_vw_old + q2_wi_old*q0_vw_old + q1_wi_old*q3_vw_old - q3_wi_old*q1_vw_old) + q2_ic_old*(q0_wi_old*q1_vw_old + q1_wi_old*q0_vw_old - q2_wi_old*q3_vw_old + q3_wi_old*q2_vw_old) - q3_ic_old*(q1_wi_old*q1_vw_old - q0_wi_old*q0_vw_old + q2_wi_old*q2_vw_old + q3_wi_old*q3_vw_old))*(q0_wi_new*q3_vw_new - q1_wi_new*q2_vw_new + q2_wi_new*q1_vw_new + q3_wi_new*q0_vw_new),   (q0_ic_old*(q0_wi_old*q1_vw_old + q1_wi_old*q0_vw_old - q2_wi_old*q3_vw_old + q3_wi_old*q2_vw_old) - q1_ic_old*(q1_wi_old*q1_vw_old - q0_wi_old*q0_vw_old + q2_wi_old*q2_vw_old + q3_wi_old*q3_vw_old) - q2_ic_old*(q0_wi_old*q3_vw_old - q1_wi_old*q2_vw_old + q2_wi_old*q1_vw_old + q3_wi_old*q0_vw_old) + q3_ic_old*(q0_wi_old*q2_vw_old + q2_wi_old*q0_vw_old + q1_wi_old*q3_vw_old - q3_wi_old*q1_vw_old))*(q1_wi_new*q1_vw_new - q0_wi_new*q0_vw_new + q2_wi_new*q2_vw_new + q3_wi_new*q3_vw_new) - (q0_ic_old*(q1_wi_old*q1_vw_old - q0_wi_old*q0_vw_old + q2_wi_old*q2_vw_old + q3_wi_old*q3_vw_old) + q1_ic_old*(q0_wi_old*q1_vw_old + q1_wi_old*q0_vw_old - q2_wi_old*q3_vw_old + q3_wi_old*q2_vw_old) + q2_ic_old*(q0_wi_old*q2_vw_old + q2_wi_old*q0_vw_old + q1_wi_old*q3_vw_old - q3_wi_old*q1_vw_old) + q3_ic_old*(q0_wi_old*q3_vw_old - q1_wi_old*q2_vw_old + q2_wi_old*q1_vw_old + q3_wi_old*q0_vw_old))*(q0_wi_new*q1_vw_new + q1_wi_new*q0_vw_new - q2_wi_new*q3_vw_new + q3_wi_new*q2_vw_new) - (q0_ic_old*(q0_wi_old*q2_vw_old + q2_wi_old*q0_vw_old + q1_wi_old*q3_vw_old - q3_wi_old*q1_vw_old) + q1_ic_old*(q0_wi_old*q3_vw_old - q1_wi_old*q2_vw_old + q2_wi_old*q1_vw_old + q3_wi_old*q0_vw_old) - q2_ic_old*(q1_wi_old*q1_vw_old - q0_wi_old*q0_vw_old + q2_wi_old*q2_vw_old + q3_wi_old*q3_vw_old) - q3_ic_old*(q0_wi_old*q1_vw_old + q1_wi_old*q0_vw_old - q2_wi_old*q3_vw_old + q3_wi_old*q2_vw_old))*(q0_wi_new*q3_vw_new - q1_wi_new*q2_vw_new + q2_wi_new*q1_vw_new + q3_wi_new*q0_vw_new) + (q0_ic_old*(q0_wi_old*q3_vw_old - q1_wi_old*q2_vw_old + q2_wi_old*q1_vw_old + q3_wi_old*q0_vw_old) - q1_ic_old*(q0_wi_old*q2_vw_old + q2_wi_old*q0_vw_old + q1_wi_old*q3_vw_old - q3_wi_old*q1_vw_old) + q2_ic_old*(q0_wi_old*q1_vw_old + q1_wi_old*q0_vw_old - q2_wi_old*q3_vw_old + q3_wi_old*q2_vw_old) - q3_ic_old*(q1_wi_old*q1_vw_old - q0_wi_old*q0_vw_old + q2_wi_old*q2_vw_old + q3_wi_old*q3_vw_old))*(q0_wi_new*q2_vw_new + q2_wi_new*q0_vw_new + q1_wi_new*q3_vw_new - q3_wi_new*q1_vw_new)]
                              [ (q0_ic_old*(q1_wi_old*q1_vw_old - q0_wi_old*q0_vw_old + q2_wi_old*q2_vw_old + q3_wi_old*q3_vw_old) + q1_ic_old*(q0_wi_old*q1_vw_old + q1_wi_old*q0_vw_old - q2_wi_old*q3_vw_old + q3_wi_old*q2_vw_old) + q2_ic_old*(q0_wi_old*q2_vw_old + q2_wi_old*q0_vw_old + q1_wi_old*q3_vw_old - q3_wi_old*q1_vw_old) + q3_ic_old*(q0_wi_old*q3_vw_old - q1_wi_old*q2_vw_old + q2_wi_old*q1_vw_old + q3_wi_old*q0_vw_old))*(q0_wi_new*q3_vw_new - q1_wi_new*q2_vw_new + q2_wi_new*q1_vw_new + q3_wi_new*q0_vw_new) + (q0_ic_old*(q0_wi_old*q1_vw_old + q1_wi_old*q0_vw_old - q2_wi_old*q3_vw_old + q3_wi_old*q2_vw_old) - q1_ic_old*(q1_wi_old*q1_vw_old - q0_wi_old*q0_vw_old + q2_wi_old*q2_vw_old + q3_wi_old*q3_vw_old) - q2_ic_old*(q0_wi_old*q3_vw_old - q1_wi_old*q2_vw_old + q2_wi_old*q1_vw_old + q3_wi_old*q0_vw_old) + q3_ic_old*(q0_wi_old*q2_vw_old + q2_wi_old*q0_vw_old + q1_wi_old*q3_vw_old - q3_wi_old*q1_vw_old))*(q0_wi_new*q2_vw_new + q2_wi_new*q0_vw_new + q1_wi_new*q3_vw_new - q3_wi_new*q1_vw_new) - (q0_ic_old*(q0_wi_old*q2_vw_old + q2_wi_old*q0_vw_old + q1_wi_old*q3_vw_old - q3_wi_old*q1_vw_old) + q1_ic_old*(q0_wi_old*q3_vw_old - q1_wi_old*q2_vw_old + q2_wi_old*q1_vw_old + q3_wi_old*q0_vw_old) - q2_ic_old*(q1_wi_old*q1_vw_old - q0_wi_old*q0_vw_old + q2_wi_old*q2_vw_old + q3_wi_old*q3_vw_old) - q3_ic_old*(q0_wi_old*q1_vw_old + q1_wi_old*q0_vw_old - q2_wi_old*q3_vw_old + q3_wi_old*q2_vw_old))*(q0_wi_new*q1_vw_new + q1_wi_new*q0_vw_new - q2_wi_new*q3_vw_new + q3_wi_new*q2_vw_new) - (q0_ic_old*(q0_wi_old*q3_vw_old - q1_wi_old*q2_vw_old + q2_wi_old*q1_vw_old + q3_wi_old*q0_vw_old) - q1_ic_old*(q0_wi_old*q2_vw_old + q2_wi_old*q0_vw_old + q1_wi_old*q3_vw_old - q3_wi_old*q1_vw_old) + q2_ic_old*(q0_wi_old*q1_vw_old + q1_wi_old*q0_vw_old - q2_wi_old*q3_vw_old + q3_wi_old*q2_vw_old) - q3_ic_old*(q1_wi_old*q1_vw_old - q0_wi_old*q0_vw_old + q2_wi_old*q2_vw_old + q3_wi_old*q3_vw_old))*(q1_wi_new*q1_vw_new - q0_wi_new*q0_vw_new + q2_wi_new*q2_vw_new + q3_wi_new*q3_vw_new),   (q0_ic_old*(q0_wi_old*q1_vw_old + q1_wi_old*q0_vw_old - q2_wi_old*q3_vw_old + q3_wi_old*q2_vw_old) - q1_ic_old*(q1_wi_old*q1_vw_old - q0_wi_old*q0_vw_old + q2_wi_old*q2_vw_old + q3_wi_old*q3_vw_old) - q2_ic_old*(q0_wi_old*q3_vw_old - q1_wi_old*q2_vw_old + q2_wi_old*q1_vw_old + q3_wi_old*q0_vw_old) + q3_ic_old*(q0_wi_old*q2_vw_old + q2_wi_old*q0_vw_old + q1_wi_old*q3_vw_old - q3_wi_old*q1_vw_old))*(q0_wi_new*q3_vw_new - q1_wi_new*q2_vw_new + q2_wi_new*q1_vw_new + q3_wi_new*q0_vw_new) - (q0_ic_old*(q1_wi_old*q1_vw_old - q0_wi_old*q0_vw_old + q2_wi_old*q2_vw_old + q3_wi_old*q3_vw_old) + q1_ic_old*(q0_wi_old*q1_vw_old + q1_wi_old*q0_vw_old - q2_wi_old*q3_vw_old + q3_wi_old*q2_vw_old) + q2_ic_old*(q0_wi_old*q2_vw_old + q2_wi_old*q0_vw_old + q1_wi_old*q3_vw_old - q3_wi_old*q1_vw_old) + q3_ic_old*(q0_wi_old*q3_vw_old - q1_wi_old*q2_vw_old + q2_wi_old*q1_vw_old + q3_wi_old*q0_vw_old))*(q0_wi_new*q2_vw_new + q2_wi_new*q0_vw_new + q1_wi_new*q3_vw_new - q3_wi_new*q1_vw_new) + (q0_ic_old*(q0_wi_old*q2_vw_old + q2_wi_old*q0_vw_old + q1_wi_old*q3_vw_old - q3_wi_old*q1_vw_old) + q1_ic_old*(q0_wi_old*q3_vw_old - q1_wi_old*q2_vw_old + q2_wi_old*q1_vw_old + q3_wi_old*q0_vw_old) - q2_ic_old*(q1_wi_old*q1_vw_old - q0_wi_old*q0_vw_old + q2_wi_old*q2_vw_old + q3_wi_old*q3_vw_old) - q3_ic_old*(q0_wi_old*q1_vw_old + q1_wi_old*q0_vw_old - q2_wi_old*q3_vw_old + q3_wi_old*q2_vw_old))*(q1_wi_new*q1_vw_new - q0_wi_new*q0_vw_new + q2_wi_new*q2_vw_new + q3_wi_new*q3_vw_new) - (q0_ic_old*(q0_wi_old*q3_vw_old - q1_wi_old*q2_vw_old + q2_wi_old*q1_vw_old + q3_wi_old*q0_vw_old) - q1_ic_old*(q0_wi_old*q2_vw_old + q2_wi_old*q0_vw_old + q1_wi_old*q3_vw_old - q3_wi_old*q1_vw_old) + q2_ic_old*(q0_wi_old*q1_vw_old + q1_wi_old*q0_vw_old - q2_wi_old*q3_vw_old + q3_wi_old*q2_vw_old) - q3_ic_old*(q1_wi_old*q1_vw_old - q0_wi_old*q0_vw_old + q2_wi_old*q2_vw_old + q3_wi_old*q3_vw_old))*(q0_wi_new*q1_vw_new + q1_wi_new*q0_vw_new - q2_wi_new*q3_vw_new + q3_wi_new*q2_vw_new),   (q0_ic_old*(q1_wi_old*q1_vw_old - q0_wi_old*q0_vw_old + q2_wi_old*q2_vw_old + q3_wi_old*q3_vw_old) + q1_ic_old*(q0_wi_old*q1_vw_old + q1_wi_old*q0_vw_old - q2_wi_old*q3_vw_old + q3_wi_old*q2_vw_old) + q2_ic_old*(q0_wi_old*q2_vw_old + q2_wi_old*q0_vw_old + q1_wi_old*q3_vw_old - q3_wi_old*q1_vw_old) + q3_ic_old*(q0_wi_old*q3_vw_old - q1_wi_old*q2_vw_old + q2_wi_old*q1_vw_old + q3_wi_old*q0_vw_old))*(q0_wi_new*q1_vw_new + q1_wi_new*q0_vw_new - q2_wi_new*q3_vw_new + q3_wi_new*q2_vw_new) - (q0_ic_old*(q0_wi_old*q1_vw_old + q1_wi_old*q0_vw_old - q2_wi_old*q3_vw_old + q3_wi_old*q2_vw_old) - q1_ic_old*(q1_wi_old*q1_vw_old - q0_wi_old*q0_vw_old + q2_wi_old*q2_vw_old + q3_wi_old*q3_vw_old) - q2_ic_old*(q0_wi_old*q3_vw_old - q1_wi_old*q2_vw_old + q2_wi_old*q1_vw_old + q3_wi_old*q0_vw_old) + q3_ic_old*(q0_wi_old*q2_vw_old + q2_wi_old*q0_vw_old + q1_wi_old*q3_vw_old - q3_wi_old*q1_vw_old))*(q1_wi_new*q1_vw_new - q0_wi_new*q0_vw_new + q2_wi_new*q2_vw_new + q3_wi_new*q3_vw_new) + (q0_ic_old*(q0_wi_old*q2_vw_old + q2_wi_old*q0_vw_old + q1_wi_old*q3_vw_old - q3_wi_old*q1_vw_old) + q1_ic_old*(q0_wi_old*q3_vw_old - q1_wi_old*q2_vw_old + q2_wi_old*q1_vw_old + q3_wi_old*q0_vw_old) - q2_ic_old*(q1_wi_old*q1_vw_old - q0_wi_old*q0_vw_old + q2_wi_old*q2_vw_old + q3_wi_old*q3_vw_old) - q3_ic_old*(q0_wi_old*q1_vw_old + q1_wi_old*q0_vw_old - q2_wi_old*q3_vw_old + q3_wi_old*q2_vw_old))*(q0_wi_new*q3_vw_new - q1_wi_new*q2_vw_new + q2_wi_new*q1_vw_new + q3_wi_new*q0_vw_new) - (q0_ic_old*(q0_wi_old*q3_vw_old - q1_wi_old*q2_vw_old + q2_wi_old*q1_vw_old + q3_wi_old*q0_vw_old) - q1_ic_old*(q0_wi_old*q2_vw_old + q2_wi_old*q0_vw_old + q1_wi_old*q3_vw_old - q3_wi_old*q1_vw_old) + q2_ic_old*(q0_wi_old*q1_vw_old + q1_wi_old*q0_vw_old - q2_wi_old*q3_vw_old + q3_wi_old*q2_vw_old) - q3_ic_old*(q1_wi_old*q1_vw_old - q0_wi_old*q0_vw_old + q2_wi_old*q2_vw_old + q3_wi_old*q3_vw_old))*(q0_wi_new*q2_vw_new + q2_wi_new*q0_vw_new + q1_wi_new*q3_vw_new - q3_wi_new*q1_vw_new), - (q0_ic_old*(q1_wi_old*q1_vw_old - q0_wi_old*q0_vw_old + q2_wi_old*q2_vw_old + q3_wi_old*q3_vw_old) + q1_ic_old*(q0_wi_old*q1_vw_old + q1_wi_old*q0_vw_old - q2_wi_old*q3_vw_old + q3_wi_old*q2_vw_old) + q2_ic_old*(q0_wi_old*q2_vw_old + q2_wi_old*q0_vw_old + q1_wi_old*q3_vw_old - q3_wi_old*q1_vw_old) + q3_ic_old*(q0_wi_old*q3_vw_old - q1_wi_old*q2_vw_old + q2_wi_old*q1_vw_old + q3_wi_old*q0_vw_old))*(q1_wi_new*q1_vw_new - q0_wi_new*q0_vw_new + q2_wi_new*q2_vw_new + q3_wi_new*q3_vw_new) - (q0_ic_old*(q0_wi_old*q1_vw_old + q1_wi_old*q0_vw_old - q2_wi_old*q3_vw_old + q3_wi_old*q2_vw_old) - q1_ic_old*(q1_wi_old*q1_vw_old - q0_wi_old*q0_vw_old + q2_wi_old*q2_vw_old + q3_wi_old*q3_vw_old) - q2_ic_old*(q0_wi_old*q3_vw_old - q1_wi_old*q2_vw_old + q2_wi_old*q1_vw_old + q3_wi_old*q0_vw_old) + q3_ic_old*(q0_wi_old*q2_vw_old + q2_wi_old*q0_vw_old + q1_wi_old*q3_vw_old - q3_wi_old*q1_vw_old))*(q0_wi_new*q1_vw_new + q1_wi_new*q0_vw_new - q2_wi_new*q3_vw_new + q3_wi_new*q2_vw_new) - (q0_ic_old*(q0_wi_old*q2_vw_old + q2_wi_old*q0_vw_old + q1_wi_old*q3_vw_old - q3_wi_old*q1_vw_old) + q1_ic_old*(q0_wi_old*q3_vw_old - q1_wi_old*q2_vw_old + q2_wi_old*q1_vw_old + q3_wi_old*q0_vw_old) - q2_ic_old*(q1_wi_old*q1_vw_old - q0_wi_old*q0_vw_old + q2_wi_old*q2_vw_old + q3_wi_old*q3_vw_old) - q3_ic_old*(q0_wi_old*q1_vw_old + q1_wi_old*q0_vw_old - q2_wi_old*q3_vw_old + q3_wi_old*q2_vw_old))*(q0_wi_new*q2_vw_new + q2_wi_new*q0_vw_new + q1_wi_new*q3_vw_new - q3_wi_new*q1_vw_new) - (q0_ic_old*(q0_wi_old*q3_vw_old - q1_wi_old*q2_vw_old + q2_wi_old*q1_vw_old + q3_wi_old*q0_vw_old) - q1_ic_old*(q0_wi_old*q2_vw_old + q2_wi_old*q0_vw_old + q1_wi_old*q3_vw_old - q3_wi_old*q1_vw_old) + q2_ic_old*(q0_wi_old*q1_vw_old + q1_wi_old*q0_vw_old - q2_wi_old*q3_vw_old + q3_wi_old*q2_vw_old) - q3_ic_old*(q1_wi_old*q1_vw_old - q0_wi_old*q0_vw_old + q2_wi_old*q2_vw_old + q3_wi_old*q3_vw_old))*(q0_wi_new*q3_vw_new - q1_wi_new*q2_vw_new + q2_wi_new*q1_vw_new + q3_wi_new*q0_vw_new)]];

elseif (param.fusion.camFixQuatic == 1)
    H_z_q_relative_qic_new = zeros(4,4);

end

% qH(k+m)(q_vw) = delta(z_q_relative) / delta(q_vw_k+m)
if (param.fusion.camFixQuatvw == 0)
    H_z_q_relative_qvw_new = [[ (q0_ic_old*(q1_wi_old*q1_vw_old - q0_wi_old*q0_vw_old + q2_wi_old*q2_vw_old + q3_wi_old*q3_vw_old) + q1_ic_old*(q0_wi_old*q1_vw_old + q1_wi_old*q0_vw_old - q2_wi_old*q3_vw_old + q3_wi_old*q2_vw_old) + q2_ic_old*(q0_wi_old*q2_vw_old + q2_wi_old*q0_vw_old + q1_wi_old*q3_vw_old - q3_wi_old*q1_vw_old) + q3_ic_old*(q0_wi_old*q3_vw_old - q1_wi_old*q2_vw_old + q2_wi_old*q1_vw_old + q3_wi_old*q0_vw_old))*(q1_ic_new*q1_wi_new - q0_ic_new*q0_wi_new + q2_ic_new*q2_wi_new + q3_ic_new*q3_wi_new) + (q0_ic_old*(q0_wi_old*q1_vw_old + q1_wi_old*q0_vw_old - q2_wi_old*q3_vw_old + q3_wi_old*q2_vw_old) - q1_ic_old*(q1_wi_old*q1_vw_old - q0_wi_old*q0_vw_old + q2_wi_old*q2_vw_old + q3_wi_old*q3_vw_old) - q2_ic_old*(q0_wi_old*q3_vw_old - q1_wi_old*q2_vw_old + q2_wi_old*q1_vw_old + q3_wi_old*q0_vw_old) + q3_ic_old*(q0_wi_old*q2_vw_old + q2_wi_old*q0_vw_old + q1_wi_old*q3_vw_old - q3_wi_old*q1_vw_old))*(q0_ic_new*q1_wi_new + q1_ic_new*q0_wi_new - q2_ic_new*q3_wi_new + q3_ic_new*q2_wi_new) + (q0_ic_old*(q0_wi_old*q2_vw_old + q2_wi_old*q0_vw_old + q1_wi_old*q3_vw_old - q3_wi_old*q1_vw_old) + q1_ic_old*(q0_wi_old*q3_vw_old - q1_wi_old*q2_vw_old + q2_wi_old*q1_vw_old + q3_wi_old*q0_vw_old) - q2_ic_old*(q1_wi_old*q1_vw_old - q0_wi_old*q0_vw_old + q2_wi_old*q2_vw_old + q3_wi_old*q3_vw_old) - q3_ic_old*(q0_wi_old*q1_vw_old + q1_wi_old*q0_vw_old - q2_wi_old*q3_vw_old + q3_wi_old*q2_vw_old))*(q0_ic_new*q2_wi_new + q2_ic_new*q0_wi_new + q1_ic_new*q3_wi_new - q3_ic_new*q1_wi_new) + (q0_ic_old*(q0_wi_old*q3_vw_old - q1_wi_old*q2_vw_old + q2_wi_old*q1_vw_old + q3_wi_old*q0_vw_old) - q1_ic_old*(q0_wi_old*q2_vw_old + q2_wi_old*q0_vw_old + q1_wi_old*q3_vw_old - q3_wi_old*q1_vw_old) + q2_ic_old*(q0_wi_old*q1_vw_old + q1_wi_old*q0_vw_old - q2_wi_old*q3_vw_old + q3_wi_old*q2_vw_old) - q3_ic_old*(q1_wi_old*q1_vw_old - q0_wi_old*q0_vw_old + q2_wi_old*q2_vw_old + q3_wi_old*q3_vw_old))*(q0_ic_new*q3_wi_new - q1_ic_new*q2_wi_new + q2_ic_new*q1_wi_new + q3_ic_new*q0_wi_new),   (q0_ic_old*(q1_wi_old*q1_vw_old - q0_wi_old*q0_vw_old + q2_wi_old*q2_vw_old + q3_wi_old*q3_vw_old) + q1_ic_old*(q0_wi_old*q1_vw_old + q1_wi_old*q0_vw_old - q2_wi_old*q3_vw_old + q3_wi_old*q2_vw_old) + q2_ic_old*(q0_wi_old*q2_vw_old + q2_wi_old*q0_vw_old + q1_wi_old*q3_vw_old - q3_wi_old*q1_vw_old) + q3_ic_old*(q0_wi_old*q3_vw_old - q1_wi_old*q2_vw_old + q2_wi_old*q1_vw_old + q3_wi_old*q0_vw_old))*(q0_ic_new*q1_wi_new + q1_ic_new*q0_wi_new - q2_ic_new*q3_wi_new + q3_ic_new*q2_wi_new) - (q0_ic_old*(q0_wi_old*q1_vw_old + q1_wi_old*q0_vw_old - q2_wi_old*q3_vw_old + q3_wi_old*q2_vw_old) - q1_ic_old*(q1_wi_old*q1_vw_old - q0_wi_old*q0_vw_old + q2_wi_old*q2_vw_old + q3_wi_old*q3_vw_old) - q2_ic_old*(q0_wi_old*q3_vw_old - q1_wi_old*q2_vw_old + q2_wi_old*q1_vw_old + q3_wi_old*q0_vw_old) + q3_ic_old*(q0_wi_old*q2_vw_old + q2_wi_old*q0_vw_old + q1_wi_old*q3_vw_old - q3_wi_old*q1_vw_old))*(q1_ic_new*q1_wi_new - q0_ic_new*q0_wi_new + q2_ic_new*q2_wi_new + q3_ic_new*q3_wi_new) - (q0_ic_old*(q0_wi_old*q2_vw_old + q2_wi_old*q0_vw_old + q1_wi_old*q3_vw_old - q3_wi_old*q1_vw_old) + q1_ic_old*(q0_wi_old*q3_vw_old - q1_wi_old*q2_vw_old + q2_wi_old*q1_vw_old + q3_wi_old*q0_vw_old) - q2_ic_old*(q1_wi_old*q1_vw_old - q0_wi_old*q0_vw_old + q2_wi_old*q2_vw_old + q3_wi_old*q3_vw_old) - q3_ic_old*(q0_wi_old*q1_vw_old + q1_wi_old*q0_vw_old - q2_wi_old*q3_vw_old + q3_wi_old*q2_vw_old))*(q0_ic_new*q3_wi_new - q1_ic_new*q2_wi_new + q2_ic_new*q1_wi_new + q3_ic_new*q0_wi_new) + (q0_ic_old*(q0_wi_old*q3_vw_old - q1_wi_old*q2_vw_old + q2_wi_old*q1_vw_old + q3_wi_old*q0_vw_old) - q1_ic_old*(q0_wi_old*q2_vw_old + q2_wi_old*q0_vw_old + q1_wi_old*q3_vw_old - q3_wi_old*q1_vw_old) + q2_ic_old*(q0_wi_old*q1_vw_old + q1_wi_old*q0_vw_old - q2_wi_old*q3_vw_old + q3_wi_old*q2_vw_old) - q3_ic_old*(q1_wi_old*q1_vw_old - q0_wi_old*q0_vw_old + q2_wi_old*q2_vw_old + q3_wi_old*q3_vw_old))*(q0_ic_new*q2_wi_new + q2_ic_new*q0_wi_new + q1_ic_new*q3_wi_new - q3_ic_new*q1_wi_new),   (q0_ic_old*(q1_wi_old*q1_vw_old - q0_wi_old*q0_vw_old + q2_wi_old*q2_vw_old + q3_wi_old*q3_vw_old) + q1_ic_old*(q0_wi_old*q1_vw_old + q1_wi_old*q0_vw_old - q2_wi_old*q3_vw_old + q3_wi_old*q2_vw_old) + q2_ic_old*(q0_wi_old*q2_vw_old + q2_wi_old*q0_vw_old + q1_wi_old*q3_vw_old - q3_wi_old*q1_vw_old) + q3_ic_old*(q0_wi_old*q3_vw_old - q1_wi_old*q2_vw_old + q2_wi_old*q1_vw_old + q3_wi_old*q0_vw_old))*(q0_ic_new*q2_wi_new + q2_ic_new*q0_wi_new + q1_ic_new*q3_wi_new - q3_ic_new*q1_wi_new) + (q0_ic_old*(q0_wi_old*q1_vw_old + q1_wi_old*q0_vw_old - q2_wi_old*q3_vw_old + q3_wi_old*q2_vw_old) - q1_ic_old*(q1_wi_old*q1_vw_old - q0_wi_old*q0_vw_old + q2_wi_old*q2_vw_old + q3_wi_old*q3_vw_old) - q2_ic_old*(q0_wi_old*q3_vw_old - q1_wi_old*q2_vw_old + q2_wi_old*q1_vw_old + q3_wi_old*q0_vw_old) + q3_ic_old*(q0_wi_old*q2_vw_old + q2_wi_old*q0_vw_old + q1_wi_old*q3_vw_old - q3_wi_old*q1_vw_old))*(q0_ic_new*q3_wi_new - q1_ic_new*q2_wi_new + q2_ic_new*q1_wi_new + q3_ic_new*q0_wi_new) - (q0_ic_old*(q0_wi_old*q2_vw_old + q2_wi_old*q0_vw_old + q1_wi_old*q3_vw_old - q3_wi_old*q1_vw_old) + q1_ic_old*(q0_wi_old*q3_vw_old - q1_wi_old*q2_vw_old + q2_wi_old*q1_vw_old + q3_wi_old*q0_vw_old) - q2_ic_old*(q1_wi_old*q1_vw_old - q0_wi_old*q0_vw_old + q2_wi_old*q2_vw_old + q3_wi_old*q3_vw_old) - q3_ic_old*(q0_wi_old*q1_vw_old + q1_wi_old*q0_vw_old - q2_wi_old*q3_vw_old + q3_wi_old*q2_vw_old))*(q1_ic_new*q1_wi_new - q0_ic_new*q0_wi_new + q2_ic_new*q2_wi_new + q3_ic_new*q3_wi_new) - (q0_ic_old*(q0_wi_old*q3_vw_old - q1_wi_old*q2_vw_old + q2_wi_old*q1_vw_old + q3_wi_old*q0_vw_old) - q1_ic_old*(q0_wi_old*q2_vw_old + q2_wi_old*q0_vw_old + q1_wi_old*q3_vw_old - q3_wi_old*q1_vw_old) + q2_ic_old*(q0_wi_old*q1_vw_old + q1_wi_old*q0_vw_old - q2_wi_old*q3_vw_old + q3_wi_old*q2_vw_old) - q3_ic_old*(q1_wi_old*q1_vw_old - q0_wi_old*q0_vw_old + q2_wi_old*q2_vw_old + q3_wi_old*q3_vw_old))*(q0_ic_new*q1_wi_new + q1_ic_new*q0_wi_new - q2_ic_new*q3_wi_new + q3_ic_new*q2_wi_new),   (q0_ic_old*(q1_wi_old*q1_vw_old - q0_wi_old*q0_vw_old + q2_wi_old*q2_vw_old + q3_wi_old*q3_vw_old) + q1_ic_old*(q0_wi_old*q1_vw_old + q1_wi_old*q0_vw_old - q2_wi_old*q3_vw_old + q3_wi_old*q2_vw_old) + q2_ic_old*(q0_wi_old*q2_vw_old + q2_wi_old*q0_vw_old + q1_wi_old*q3_vw_old - q3_wi_old*q1_vw_old) + q3_ic_old*(q0_wi_old*q3_vw_old - q1_wi_old*q2_vw_old + q2_wi_old*q1_vw_old + q3_wi_old*q0_vw_old))*(q0_ic_new*q3_wi_new - q1_ic_new*q2_wi_new + q2_ic_new*q1_wi_new + q3_ic_new*q0_wi_new) - (q0_ic_old*(q0_wi_old*q1_vw_old + q1_wi_old*q0_vw_old - q2_wi_old*q3_vw_old + q3_wi_old*q2_vw_old) - q1_ic_old*(q1_wi_old*q1_vw_old - q0_wi_old*q0_vw_old + q2_wi_old*q2_vw_old + q3_wi_old*q3_vw_old) - q2_ic_old*(q0_wi_old*q3_vw_old - q1_wi_old*q2_vw_old + q2_wi_old*q1_vw_old + q3_wi_old*q0_vw_old) + q3_ic_old*(q0_wi_old*q2_vw_old + q2_wi_old*q0_vw_old + q1_wi_old*q3_vw_old - q3_wi_old*q1_vw_old))*(q0_ic_new*q2_wi_new + q2_ic_new*q0_wi_new + q1_ic_new*q3_wi_new - q3_ic_new*q1_wi_new) + (q0_ic_old*(q0_wi_old*q2_vw_old + q2_wi_old*q0_vw_old + q1_wi_old*q3_vw_old - q3_wi_old*q1_vw_old) + q1_ic_old*(q0_wi_old*q3_vw_old - q1_wi_old*q2_vw_old + q2_wi_old*q1_vw_old + q3_wi_old*q0_vw_old) - q2_ic_old*(q1_wi_old*q1_vw_old - q0_wi_old*q0_vw_old + q2_wi_old*q2_vw_old + q3_wi_old*q3_vw_old) - q3_ic_old*(q0_wi_old*q1_vw_old + q1_wi_old*q0_vw_old - q2_wi_old*q3_vw_old + q3_wi_old*q2_vw_old))*(q0_ic_new*q1_wi_new + q1_ic_new*q0_wi_new - q2_ic_new*q3_wi_new + q3_ic_new*q2_wi_new) - (q0_ic_old*(q0_wi_old*q3_vw_old - q1_wi_old*q2_vw_old + q2_wi_old*q1_vw_old + q3_wi_old*q0_vw_old) - q1_ic_old*(q0_wi_old*q2_vw_old + q2_wi_old*q0_vw_old + q1_wi_old*q3_vw_old - q3_wi_old*q1_vw_old) + q2_ic_old*(q0_wi_old*q1_vw_old + q1_wi_old*q0_vw_old - q2_wi_old*q3_vw_old + q3_wi_old*q2_vw_old) - q3_ic_old*(q1_wi_old*q1_vw_old - q0_wi_old*q0_vw_old + q2_wi_old*q2_vw_old + q3_wi_old*q3_vw_old))*(q1_ic_new*q1_wi_new - q0_ic_new*q0_wi_new + q2_ic_new*q2_wi_new + q3_ic_new*q3_wi_new)]
                              [ (q0_ic_old*(q1_wi_old*q1_vw_old - q0_wi_old*q0_vw_old + q2_wi_old*q2_vw_old + q3_wi_old*q3_vw_old) + q1_ic_old*(q0_wi_old*q1_vw_old + q1_wi_old*q0_vw_old - q2_wi_old*q3_vw_old + q3_wi_old*q2_vw_old) + q2_ic_old*(q0_wi_old*q2_vw_old + q2_wi_old*q0_vw_old + q1_wi_old*q3_vw_old - q3_wi_old*q1_vw_old) + q3_ic_old*(q0_wi_old*q3_vw_old - q1_wi_old*q2_vw_old + q2_wi_old*q1_vw_old + q3_wi_old*q0_vw_old))*(q0_ic_new*q1_wi_new + q1_ic_new*q0_wi_new - q2_ic_new*q3_wi_new + q3_ic_new*q2_wi_new) - (q0_ic_old*(q0_wi_old*q1_vw_old + q1_wi_old*q0_vw_old - q2_wi_old*q3_vw_old + q3_wi_old*q2_vw_old) - q1_ic_old*(q1_wi_old*q1_vw_old - q0_wi_old*q0_vw_old + q2_wi_old*q2_vw_old + q3_wi_old*q3_vw_old) - q2_ic_old*(q0_wi_old*q3_vw_old - q1_wi_old*q2_vw_old + q2_wi_old*q1_vw_old + q3_wi_old*q0_vw_old) + q3_ic_old*(q0_wi_old*q2_vw_old + q2_wi_old*q0_vw_old + q1_wi_old*q3_vw_old - q3_wi_old*q1_vw_old))*(q1_ic_new*q1_wi_new - q0_ic_new*q0_wi_new + q2_ic_new*q2_wi_new + q3_ic_new*q3_wi_new) + (q0_ic_old*(q0_wi_old*q2_vw_old + q2_wi_old*q0_vw_old + q1_wi_old*q3_vw_old - q3_wi_old*q1_vw_old) + q1_ic_old*(q0_wi_old*q3_vw_old - q1_wi_old*q2_vw_old + q2_wi_old*q1_vw_old + q3_wi_old*q0_vw_old) - q2_ic_old*(q1_wi_old*q1_vw_old - q0_wi_old*q0_vw_old + q2_wi_old*q2_vw_old + q3_wi_old*q3_vw_old) - q3_ic_old*(q0_wi_old*q1_vw_old + q1_wi_old*q0_vw_old - q2_wi_old*q3_vw_old + q3_wi_old*q2_vw_old))*(q0_ic_new*q3_wi_new - q1_ic_new*q2_wi_new + q2_ic_new*q1_wi_new + q3_ic_new*q0_wi_new) - (q0_ic_old*(q0_wi_old*q3_vw_old - q1_wi_old*q2_vw_old + q2_wi_old*q1_vw_old + q3_wi_old*q0_vw_old) - q1_ic_old*(q0_wi_old*q2_vw_old + q2_wi_old*q0_vw_old + q1_wi_old*q3_vw_old - q3_wi_old*q1_vw_old) + q2_ic_old*(q0_wi_old*q1_vw_old + q1_wi_old*q0_vw_old - q2_wi_old*q3_vw_old + q3_wi_old*q2_vw_old) - q3_ic_old*(q1_wi_old*q1_vw_old - q0_wi_old*q0_vw_old + q2_wi_old*q2_vw_old + q3_wi_old*q3_vw_old))*(q0_ic_new*q2_wi_new + q2_ic_new*q0_wi_new + q1_ic_new*q3_wi_new - q3_ic_new*q1_wi_new),   (q0_ic_old*(q0_wi_old*q2_vw_old + q2_wi_old*q0_vw_old + q1_wi_old*q3_vw_old - q3_wi_old*q1_vw_old) + q1_ic_old*(q0_wi_old*q3_vw_old - q1_wi_old*q2_vw_old + q2_wi_old*q1_vw_old + q3_wi_old*q0_vw_old) - q2_ic_old*(q1_wi_old*q1_vw_old - q0_wi_old*q0_vw_old + q2_wi_old*q2_vw_old + q3_wi_old*q3_vw_old) - q3_ic_old*(q0_wi_old*q1_vw_old + q1_wi_old*q0_vw_old - q2_wi_old*q3_vw_old + q3_wi_old*q2_vw_old))*(q0_ic_new*q2_wi_new + q2_ic_new*q0_wi_new + q1_ic_new*q3_wi_new - q3_ic_new*q1_wi_new) - (q0_ic_old*(q0_wi_old*q1_vw_old + q1_wi_old*q0_vw_old - q2_wi_old*q3_vw_old + q3_wi_old*q2_vw_old) - q1_ic_old*(q1_wi_old*q1_vw_old - q0_wi_old*q0_vw_old + q2_wi_old*q2_vw_old + q3_wi_old*q3_vw_old) - q2_ic_old*(q0_wi_old*q3_vw_old - q1_wi_old*q2_vw_old + q2_wi_old*q1_vw_old + q3_wi_old*q0_vw_old) + q3_ic_old*(q0_wi_old*q2_vw_old + q2_wi_old*q0_vw_old + q1_wi_old*q3_vw_old - q3_wi_old*q1_vw_old))*(q0_ic_new*q1_wi_new + q1_ic_new*q0_wi_new - q2_ic_new*q3_wi_new + q3_ic_new*q2_wi_new) - (q0_ic_old*(q1_wi_old*q1_vw_old - q0_wi_old*q0_vw_old + q2_wi_old*q2_vw_old + q3_wi_old*q3_vw_old) + q1_ic_old*(q0_wi_old*q1_vw_old + q1_wi_old*q0_vw_old - q2_wi_old*q3_vw_old + q3_wi_old*q2_vw_old) + q2_ic_old*(q0_wi_old*q2_vw_old + q2_wi_old*q0_vw_old + q1_wi_old*q3_vw_old - q3_wi_old*q1_vw_old) + q3_ic_old*(q0_wi_old*q3_vw_old - q1_wi_old*q2_vw_old + q2_wi_old*q1_vw_old + q3_wi_old*q0_vw_old))*(q1_ic_new*q1_wi_new - q0_ic_new*q0_wi_new + q2_ic_new*q2_wi_new + q3_ic_new*q3_wi_new) + (q0_ic_old*(q0_wi_old*q3_vw_old - q1_wi_old*q2_vw_old + q2_wi_old*q1_vw_old + q3_wi_old*q0_vw_old) - q1_ic_old*(q0_wi_old*q2_vw_old + q2_wi_old*q0_vw_old + q1_wi_old*q3_vw_old - q3_wi_old*q1_vw_old) + q2_ic_old*(q0_wi_old*q1_vw_old + q1_wi_old*q0_vw_old - q2_wi_old*q3_vw_old + q3_wi_old*q2_vw_old) - q3_ic_old*(q1_wi_old*q1_vw_old - q0_wi_old*q0_vw_old + q2_wi_old*q2_vw_old + q3_wi_old*q3_vw_old))*(q0_ic_new*q3_wi_new - q1_ic_new*q2_wi_new + q2_ic_new*q1_wi_new + q3_ic_new*q0_wi_new),   (q0_ic_old*(q1_wi_old*q1_vw_old - q0_wi_old*q0_vw_old + q2_wi_old*q2_vw_old + q3_wi_old*q3_vw_old) + q1_ic_old*(q0_wi_old*q1_vw_old + q1_wi_old*q0_vw_old - q2_wi_old*q3_vw_old + q3_wi_old*q2_vw_old) + q2_ic_old*(q0_wi_old*q2_vw_old + q2_wi_old*q0_vw_old + q1_wi_old*q3_vw_old - q3_wi_old*q1_vw_old) + q3_ic_old*(q0_wi_old*q3_vw_old - q1_wi_old*q2_vw_old + q2_wi_old*q1_vw_old + q3_wi_old*q0_vw_old))*(q0_ic_new*q3_wi_new - q1_ic_new*q2_wi_new + q2_ic_new*q1_wi_new + q3_ic_new*q0_wi_new) - (q0_ic_old*(q0_wi_old*q1_vw_old + q1_wi_old*q0_vw_old - q2_wi_old*q3_vw_old + q3_wi_old*q2_vw_old) - q1_ic_old*(q1_wi_old*q1_vw_old - q0_wi_old*q0_vw_old + q2_wi_old*q2_vw_old + q3_wi_old*q3_vw_old) - q2_ic_old*(q0_wi_old*q3_vw_old - q1_wi_old*q2_vw_old + q2_wi_old*q1_vw_old + q3_wi_old*q0_vw_old) + q3_ic_old*(q0_wi_old*q2_vw_old + q2_wi_old*q0_vw_old + q1_wi_old*q3_vw_old - q3_wi_old*q1_vw_old))*(q0_ic_new*q2_wi_new + q2_ic_new*q0_wi_new + q1_ic_new*q3_wi_new - q3_ic_new*q1_wi_new) - (q0_ic_old*(q0_wi_old*q2_vw_old + q2_wi_old*q0_vw_old + q1_wi_old*q3_vw_old - q3_wi_old*q1_vw_old) + q1_ic_old*(q0_wi_old*q3_vw_old - q1_wi_old*q2_vw_old + q2_wi_old*q1_vw_old + q3_wi_old*q0_vw_old) - q2_ic_old*(q1_wi_old*q1_vw_old - q0_wi_old*q0_vw_old + q2_wi_old*q2_vw_old + q3_wi_old*q3_vw_old) - q3_ic_old*(q0_wi_old*q1_vw_old + q1_wi_old*q0_vw_old - q2_wi_old*q3_vw_old + q3_wi_old*q2_vw_old))*(q0_ic_new*q1_wi_new + q1_ic_new*q0_wi_new - q2_ic_new*q3_wi_new + q3_ic_new*q2_wi_new) + (q0_ic_old*(q0_wi_old*q3_vw_old - q1_wi_old*q2_vw_old + q2_wi_old*q1_vw_old + q3_wi_old*q0_vw_old) - q1_ic_old*(q0_wi_old*q2_vw_old + q2_wi_old*q0_vw_old + q1_wi_old*q3_vw_old - q3_wi_old*q1_vw_old) + q2_ic_old*(q0_wi_old*q1_vw_old + q1_wi_old*q0_vw_old - q2_wi_old*q3_vw_old + q3_wi_old*q2_vw_old) - q3_ic_old*(q1_wi_old*q1_vw_old - q0_wi_old*q0_vw_old + q2_wi_old*q2_vw_old + q3_wi_old*q3_vw_old))*(q1_ic_new*q1_wi_new - q0_ic_new*q0_wi_new + q2_ic_new*q2_wi_new + q3_ic_new*q3_wi_new), - (q0_ic_old*(q1_wi_old*q1_vw_old - q0_wi_old*q0_vw_old + q2_wi_old*q2_vw_old + q3_wi_old*q3_vw_old) + q1_ic_old*(q0_wi_old*q1_vw_old + q1_wi_old*q0_vw_old - q2_wi_old*q3_vw_old + q3_wi_old*q2_vw_old) + q2_ic_old*(q0_wi_old*q2_vw_old + q2_wi_old*q0_vw_old + q1_wi_old*q3_vw_old - q3_wi_old*q1_vw_old) + q3_ic_old*(q0_wi_old*q3_vw_old - q1_wi_old*q2_vw_old + q2_wi_old*q1_vw_old + q3_wi_old*q0_vw_old))*(q0_ic_new*q2_wi_new + q2_ic_new*q0_wi_new + q1_ic_new*q3_wi_new - q3_ic_new*q1_wi_new) - (q0_ic_old*(q0_wi_old*q1_vw_old + q1_wi_old*q0_vw_old - q2_wi_old*q3_vw_old + q3_wi_old*q2_vw_old) - q1_ic_old*(q1_wi_old*q1_vw_old - q0_wi_old*q0_vw_old + q2_wi_old*q2_vw_old + q3_wi_old*q3_vw_old) - q2_ic_old*(q0_wi_old*q3_vw_old - q1_wi_old*q2_vw_old + q2_wi_old*q1_vw_old + q3_wi_old*q0_vw_old) + q3_ic_old*(q0_wi_old*q2_vw_old + q2_wi_old*q0_vw_old + q1_wi_old*q3_vw_old - q3_wi_old*q1_vw_old))*(q0_ic_new*q3_wi_new - q1_ic_new*q2_wi_new + q2_ic_new*q1_wi_new + q3_ic_new*q0_wi_new) - (q0_ic_old*(q0_wi_old*q2_vw_old + q2_wi_old*q0_vw_old + q1_wi_old*q3_vw_old - q3_wi_old*q1_vw_old) + q1_ic_old*(q0_wi_old*q3_vw_old - q1_wi_old*q2_vw_old + q2_wi_old*q1_vw_old + q3_wi_old*q0_vw_old) - q2_ic_old*(q1_wi_old*q1_vw_old - q0_wi_old*q0_vw_old + q2_wi_old*q2_vw_old + q3_wi_old*q3_vw_old) - q3_ic_old*(q0_wi_old*q1_vw_old + q1_wi_old*q0_vw_old - q2_wi_old*q3_vw_old + q3_wi_old*q2_vw_old))*(q1_ic_new*q1_wi_new - q0_ic_new*q0_wi_new + q2_ic_new*q2_wi_new + q3_ic_new*q3_wi_new) - (q0_ic_old*(q0_wi_old*q3_vw_old - q1_wi_old*q2_vw_old + q2_wi_old*q1_vw_old + q3_wi_old*q0_vw_old) - q1_ic_old*(q0_wi_old*q2_vw_old + q2_wi_old*q0_vw_old + q1_wi_old*q3_vw_old - q3_wi_old*q1_vw_old) + q2_ic_old*(q0_wi_old*q1_vw_old + q1_wi_old*q0_vw_old - q2_wi_old*q3_vw_old + q3_wi_old*q2_vw_old) - q3_ic_old*(q1_wi_old*q1_vw_old - q0_wi_old*q0_vw_old + q2_wi_old*q2_vw_old + q3_wi_old*q3_vw_old))*(q0_ic_new*q1_wi_new + q1_ic_new*q0_wi_new - q2_ic_new*q3_wi_new + q3_ic_new*q2_wi_new)]
                              [ (q0_ic_old*(q1_wi_old*q1_vw_old - q0_wi_old*q0_vw_old + q2_wi_old*q2_vw_old + q3_wi_old*q3_vw_old) + q1_ic_old*(q0_wi_old*q1_vw_old + q1_wi_old*q0_vw_old - q2_wi_old*q3_vw_old + q3_wi_old*q2_vw_old) + q2_ic_old*(q0_wi_old*q2_vw_old + q2_wi_old*q0_vw_old + q1_wi_old*q3_vw_old - q3_wi_old*q1_vw_old) + q3_ic_old*(q0_wi_old*q3_vw_old - q1_wi_old*q2_vw_old + q2_wi_old*q1_vw_old + q3_wi_old*q0_vw_old))*(q0_ic_new*q2_wi_new + q2_ic_new*q0_wi_new + q1_ic_new*q3_wi_new - q3_ic_new*q1_wi_new) - (q0_ic_old*(q0_wi_old*q1_vw_old + q1_wi_old*q0_vw_old - q2_wi_old*q3_vw_old + q3_wi_old*q2_vw_old) - q1_ic_old*(q1_wi_old*q1_vw_old - q0_wi_old*q0_vw_old + q2_wi_old*q2_vw_old + q3_wi_old*q3_vw_old) - q2_ic_old*(q0_wi_old*q3_vw_old - q1_wi_old*q2_vw_old + q2_wi_old*q1_vw_old + q3_wi_old*q0_vw_old) + q3_ic_old*(q0_wi_old*q2_vw_old + q2_wi_old*q0_vw_old + q1_wi_old*q3_vw_old - q3_wi_old*q1_vw_old))*(q0_ic_new*q3_wi_new - q1_ic_new*q2_wi_new + q2_ic_new*q1_wi_new + q3_ic_new*q0_wi_new) - (q0_ic_old*(q0_wi_old*q2_vw_old + q2_wi_old*q0_vw_old + q1_wi_old*q3_vw_old - q3_wi_old*q1_vw_old) + q1_ic_old*(q0_wi_old*q3_vw_old - q1_wi_old*q2_vw_old + q2_wi_old*q1_vw_old + q3_wi_old*q0_vw_old) - q2_ic_old*(q1_wi_old*q1_vw_old - q0_wi_old*q0_vw_old + q2_wi_old*q2_vw_old + q3_wi_old*q3_vw_old) - q3_ic_old*(q0_wi_old*q1_vw_old + q1_wi_old*q0_vw_old - q2_wi_old*q3_vw_old + q3_wi_old*q2_vw_old))*(q1_ic_new*q1_wi_new - q0_ic_new*q0_wi_new + q2_ic_new*q2_wi_new + q3_ic_new*q3_wi_new) + (q0_ic_old*(q0_wi_old*q3_vw_old - q1_wi_old*q2_vw_old + q2_wi_old*q1_vw_old + q3_wi_old*q0_vw_old) - q1_ic_old*(q0_wi_old*q2_vw_old + q2_wi_old*q0_vw_old + q1_wi_old*q3_vw_old - q3_wi_old*q1_vw_old) + q2_ic_old*(q0_wi_old*q1_vw_old + q1_wi_old*q0_vw_old - q2_wi_old*q3_vw_old + q3_wi_old*q2_vw_old) - q3_ic_old*(q1_wi_old*q1_vw_old - q0_wi_old*q0_vw_old + q2_wi_old*q2_vw_old + q3_wi_old*q3_vw_old))*(q0_ic_new*q1_wi_new + q1_ic_new*q0_wi_new - q2_ic_new*q3_wi_new + q3_ic_new*q2_wi_new), - (q0_ic_old*(q1_wi_old*q1_vw_old - q0_wi_old*q0_vw_old + q2_wi_old*q2_vw_old + q3_wi_old*q3_vw_old) + q1_ic_old*(q0_wi_old*q1_vw_old + q1_wi_old*q0_vw_old - q2_wi_old*q3_vw_old + q3_wi_old*q2_vw_old) + q2_ic_old*(q0_wi_old*q2_vw_old + q2_wi_old*q0_vw_old + q1_wi_old*q3_vw_old - q3_wi_old*q1_vw_old) + q3_ic_old*(q0_wi_old*q3_vw_old - q1_wi_old*q2_vw_old + q2_wi_old*q1_vw_old + q3_wi_old*q0_vw_old))*(q0_ic_new*q3_wi_new - q1_ic_new*q2_wi_new + q2_ic_new*q1_wi_new + q3_ic_new*q0_wi_new) - (q0_ic_old*(q0_wi_old*q1_vw_old + q1_wi_old*q0_vw_old - q2_wi_old*q3_vw_old + q3_wi_old*q2_vw_old) - q1_ic_old*(q1_wi_old*q1_vw_old - q0_wi_old*q0_vw_old + q2_wi_old*q2_vw_old + q3_wi_old*q3_vw_old) - q2_ic_old*(q0_wi_old*q3_vw_old - q1_wi_old*q2_vw_old + q2_wi_old*q1_vw_old + q3_wi_old*q0_vw_old) + q3_ic_old*(q0_wi_old*q2_vw_old + q2_wi_old*q0_vw_old + q1_wi_old*q3_vw_old - q3_wi_old*q1_vw_old))*(q0_ic_new*q2_wi_new + q2_ic_new*q0_wi_new + q1_ic_new*q3_wi_new - q3_ic_new*q1_wi_new) - (q0_ic_old*(q0_wi_old*q2_vw_old + q2_wi_old*q0_vw_old + q1_wi_old*q3_vw_old - q3_wi_old*q1_vw_old) + q1_ic_old*(q0_wi_old*q3_vw_old - q1_wi_old*q2_vw_old + q2_wi_old*q1_vw_old + q3_wi_old*q0_vw_old) - q2_ic_old*(q1_wi_old*q1_vw_old - q0_wi_old*q0_vw_old + q2_wi_old*q2_vw_old + q3_wi_old*q3_vw_old) - q3_ic_old*(q0_wi_old*q1_vw_old + q1_wi_old*q0_vw_old - q2_wi_old*q3_vw_old + q3_wi_old*q2_vw_old))*(q0_ic_new*q1_wi_new + q1_ic_new*q0_wi_new - q2_ic_new*q3_wi_new + q3_ic_new*q2_wi_new) - (q0_ic_old*(q0_wi_old*q3_vw_old - q1_wi_old*q2_vw_old + q2_wi_old*q1_vw_old + q3_wi_old*q0_vw_old) - q1_ic_old*(q0_wi_old*q2_vw_old + q2_wi_old*q0_vw_old + q1_wi_old*q3_vw_old - q3_wi_old*q1_vw_old) + q2_ic_old*(q0_wi_old*q1_vw_old + q1_wi_old*q0_vw_old - q2_wi_old*q3_vw_old + q3_wi_old*q2_vw_old) - q3_ic_old*(q1_wi_old*q1_vw_old - q0_wi_old*q0_vw_old + q2_wi_old*q2_vw_old + q3_wi_old*q3_vw_old))*(q1_ic_new*q1_wi_new - q0_ic_new*q0_wi_new + q2_ic_new*q2_wi_new + q3_ic_new*q3_wi_new),   (q0_ic_old*(q0_wi_old*q1_vw_old + q1_wi_old*q0_vw_old - q2_wi_old*q3_vw_old + q3_wi_old*q2_vw_old) - q1_ic_old*(q1_wi_old*q1_vw_old - q0_wi_old*q0_vw_old + q2_wi_old*q2_vw_old + q3_wi_old*q3_vw_old) - q2_ic_old*(q0_wi_old*q3_vw_old - q1_wi_old*q2_vw_old + q2_wi_old*q1_vw_old + q3_wi_old*q0_vw_old) + q3_ic_old*(q0_wi_old*q2_vw_old + q2_wi_old*q0_vw_old + q1_wi_old*q3_vw_old - q3_wi_old*q1_vw_old))*(q0_ic_new*q1_wi_new + q1_ic_new*q0_wi_new - q2_ic_new*q3_wi_new + q3_ic_new*q2_wi_new) - (q0_ic_old*(q1_wi_old*q1_vw_old - q0_wi_old*q0_vw_old + q2_wi_old*q2_vw_old + q3_wi_old*q3_vw_old) + q1_ic_old*(q0_wi_old*q1_vw_old + q1_wi_old*q0_vw_old - q2_wi_old*q3_vw_old + q3_wi_old*q2_vw_old) + q2_ic_old*(q0_wi_old*q2_vw_old + q2_wi_old*q0_vw_old + q1_wi_old*q3_vw_old - q3_wi_old*q1_vw_old) + q3_ic_old*(q0_wi_old*q3_vw_old - q1_wi_old*q2_vw_old + q2_wi_old*q1_vw_old + q3_wi_old*q0_vw_old))*(q1_ic_new*q1_wi_new - q0_ic_new*q0_wi_new + q2_ic_new*q2_wi_new + q3_ic_new*q3_wi_new) - (q0_ic_old*(q0_wi_old*q2_vw_old + q2_wi_old*q0_vw_old + q1_wi_old*q3_vw_old - q3_wi_old*q1_vw_old) + q1_ic_old*(q0_wi_old*q3_vw_old - q1_wi_old*q2_vw_old + q2_wi_old*q1_vw_old + q3_wi_old*q0_vw_old) - q2_ic_old*(q1_wi_old*q1_vw_old - q0_wi_old*q0_vw_old + q2_wi_old*q2_vw_old + q3_wi_old*q3_vw_old) - q3_ic_old*(q0_wi_old*q1_vw_old + q1_wi_old*q0_vw_old - q2_wi_old*q3_vw_old + q3_wi_old*q2_vw_old))*(q0_ic_new*q2_wi_new + q2_ic_new*q0_wi_new + q1_ic_new*q3_wi_new - q3_ic_new*q1_wi_new) + (q0_ic_old*(q0_wi_old*q3_vw_old - q1_wi_old*q2_vw_old + q2_wi_old*q1_vw_old + q3_wi_old*q0_vw_old) - q1_ic_old*(q0_wi_old*q2_vw_old + q2_wi_old*q0_vw_old + q1_wi_old*q3_vw_old - q3_wi_old*q1_vw_old) + q2_ic_old*(q0_wi_old*q1_vw_old + q1_wi_old*q0_vw_old - q2_wi_old*q3_vw_old + q3_wi_old*q2_vw_old) - q3_ic_old*(q1_wi_old*q1_vw_old - q0_wi_old*q0_vw_old + q2_wi_old*q2_vw_old + q3_wi_old*q3_vw_old))*(q0_ic_new*q3_wi_new - q1_ic_new*q2_wi_new + q2_ic_new*q1_wi_new + q3_ic_new*q0_wi_new),   (q0_ic_old*(q1_wi_old*q1_vw_old - q0_wi_old*q0_vw_old + q2_wi_old*q2_vw_old + q3_wi_old*q3_vw_old) + q1_ic_old*(q0_wi_old*q1_vw_old + q1_wi_old*q0_vw_old - q2_wi_old*q3_vw_old + q3_wi_old*q2_vw_old) + q2_ic_old*(q0_wi_old*q2_vw_old + q2_wi_old*q0_vw_old + q1_wi_old*q3_vw_old - q3_wi_old*q1_vw_old) + q3_ic_old*(q0_wi_old*q3_vw_old - q1_wi_old*q2_vw_old + q2_wi_old*q1_vw_old + q3_wi_old*q0_vw_old))*(q0_ic_new*q1_wi_new + q1_ic_new*q0_wi_new - q2_ic_new*q3_wi_new + q3_ic_new*q2_wi_new) + (q0_ic_old*(q0_wi_old*q1_vw_old + q1_wi_old*q0_vw_old - q2_wi_old*q3_vw_old + q3_wi_old*q2_vw_old) - q1_ic_old*(q1_wi_old*q1_vw_old - q0_wi_old*q0_vw_old + q2_wi_old*q2_vw_old + q3_wi_old*q3_vw_old) - q2_ic_old*(q0_wi_old*q3_vw_old - q1_wi_old*q2_vw_old + q2_wi_old*q1_vw_old + q3_wi_old*q0_vw_old) + q3_ic_old*(q0_wi_old*q2_vw_old + q2_wi_old*q0_vw_old + q1_wi_old*q3_vw_old - q3_wi_old*q1_vw_old))*(q1_ic_new*q1_wi_new - q0_ic_new*q0_wi_new + q2_ic_new*q2_wi_new + q3_ic_new*q3_wi_new) - (q0_ic_old*(q0_wi_old*q2_vw_old + q2_wi_old*q0_vw_old + q1_wi_old*q3_vw_old - q3_wi_old*q1_vw_old) + q1_ic_old*(q0_wi_old*q3_vw_old - q1_wi_old*q2_vw_old + q2_wi_old*q1_vw_old + q3_wi_old*q0_vw_old) - q2_ic_old*(q1_wi_old*q1_vw_old - q0_wi_old*q0_vw_old + q2_wi_old*q2_vw_old + q3_wi_old*q3_vw_old) - q3_ic_old*(q0_wi_old*q1_vw_old + q1_wi_old*q0_vw_old - q2_wi_old*q3_vw_old + q3_wi_old*q2_vw_old))*(q0_ic_new*q3_wi_new - q1_ic_new*q2_wi_new + q2_ic_new*q1_wi_new + q3_ic_new*q0_wi_new) - (q0_ic_old*(q0_wi_old*q3_vw_old - q1_wi_old*q2_vw_old + q2_wi_old*q1_vw_old + q3_wi_old*q0_vw_old) - q1_ic_old*(q0_wi_old*q2_vw_old + q2_wi_old*q0_vw_old + q1_wi_old*q3_vw_old - q3_wi_old*q1_vw_old) + q2_ic_old*(q0_wi_old*q1_vw_old + q1_wi_old*q0_vw_old - q2_wi_old*q3_vw_old + q3_wi_old*q2_vw_old) - q3_ic_old*(q1_wi_old*q1_vw_old - q0_wi_old*q0_vw_old + q2_wi_old*q2_vw_old + q3_wi_old*q3_vw_old))*(q0_ic_new*q2_wi_new + q2_ic_new*q0_wi_new + q1_ic_new*q3_wi_new - q3_ic_new*q1_wi_new)]
                              [ (q0_ic_old*(q1_wi_old*q1_vw_old - q0_wi_old*q0_vw_old + q2_wi_old*q2_vw_old + q3_wi_old*q3_vw_old) + q1_ic_old*(q0_wi_old*q1_vw_old + q1_wi_old*q0_vw_old - q2_wi_old*q3_vw_old + q3_wi_old*q2_vw_old) + q2_ic_old*(q0_wi_old*q2_vw_old + q2_wi_old*q0_vw_old + q1_wi_old*q3_vw_old - q3_wi_old*q1_vw_old) + q3_ic_old*(q0_wi_old*q3_vw_old - q1_wi_old*q2_vw_old + q2_wi_old*q1_vw_old + q3_wi_old*q0_vw_old))*(q0_ic_new*q3_wi_new - q1_ic_new*q2_wi_new + q2_ic_new*q1_wi_new + q3_ic_new*q0_wi_new) + (q0_ic_old*(q0_wi_old*q1_vw_old + q1_wi_old*q0_vw_old - q2_wi_old*q3_vw_old + q3_wi_old*q2_vw_old) - q1_ic_old*(q1_wi_old*q1_vw_old - q0_wi_old*q0_vw_old + q2_wi_old*q2_vw_old + q3_wi_old*q3_vw_old) - q2_ic_old*(q0_wi_old*q3_vw_old - q1_wi_old*q2_vw_old + q2_wi_old*q1_vw_old + q3_wi_old*q0_vw_old) + q3_ic_old*(q0_wi_old*q2_vw_old + q2_wi_old*q0_vw_old + q1_wi_old*q3_vw_old - q3_wi_old*q1_vw_old))*(q0_ic_new*q2_wi_new + q2_ic_new*q0_wi_new + q1_ic_new*q3_wi_new - q3_ic_new*q1_wi_new) - (q0_ic_old*(q0_wi_old*q2_vw_old + q2_wi_old*q0_vw_old + q1_wi_old*q3_vw_old - q3_wi_old*q1_vw_old) + q1_ic_old*(q0_wi_old*q3_vw_old - q1_wi_old*q2_vw_old + q2_wi_old*q1_vw_old + q3_wi_old*q0_vw_old) - q2_ic_old*(q1_wi_old*q1_vw_old - q0_wi_old*q0_vw_old + q2_wi_old*q2_vw_old + q3_wi_old*q3_vw_old) - q3_ic_old*(q0_wi_old*q1_vw_old + q1_wi_old*q0_vw_old - q2_wi_old*q3_vw_old + q3_wi_old*q2_vw_old))*(q0_ic_new*q1_wi_new + q1_ic_new*q0_wi_new - q2_ic_new*q3_wi_new + q3_ic_new*q2_wi_new) - (q0_ic_old*(q0_wi_old*q3_vw_old - q1_wi_old*q2_vw_old + q2_wi_old*q1_vw_old + q3_wi_old*q0_vw_old) - q1_ic_old*(q0_wi_old*q2_vw_old + q2_wi_old*q0_vw_old + q1_wi_old*q3_vw_old - q3_wi_old*q1_vw_old) + q2_ic_old*(q0_wi_old*q1_vw_old + q1_wi_old*q0_vw_old - q2_wi_old*q3_vw_old + q3_wi_old*q2_vw_old) - q3_ic_old*(q1_wi_old*q1_vw_old - q0_wi_old*q0_vw_old + q2_wi_old*q2_vw_old + q3_wi_old*q3_vw_old))*(q1_ic_new*q1_wi_new - q0_ic_new*q0_wi_new + q2_ic_new*q2_wi_new + q3_ic_new*q3_wi_new),   (q0_ic_old*(q1_wi_old*q1_vw_old - q0_wi_old*q0_vw_old + q2_wi_old*q2_vw_old + q3_wi_old*q3_vw_old) + q1_ic_old*(q0_wi_old*q1_vw_old + q1_wi_old*q0_vw_old - q2_wi_old*q3_vw_old + q3_wi_old*q2_vw_old) + q2_ic_old*(q0_wi_old*q2_vw_old + q2_wi_old*q0_vw_old + q1_wi_old*q3_vw_old - q3_wi_old*q1_vw_old) + q3_ic_old*(q0_wi_old*q3_vw_old - q1_wi_old*q2_vw_old + q2_wi_old*q1_vw_old + q3_wi_old*q0_vw_old))*(q0_ic_new*q2_wi_new + q2_ic_new*q0_wi_new + q1_ic_new*q3_wi_new - q3_ic_new*q1_wi_new) - (q0_ic_old*(q0_wi_old*q1_vw_old + q1_wi_old*q0_vw_old - q2_wi_old*q3_vw_old + q3_wi_old*q2_vw_old) - q1_ic_old*(q1_wi_old*q1_vw_old - q0_wi_old*q0_vw_old + q2_wi_old*q2_vw_old + q3_wi_old*q3_vw_old) - q2_ic_old*(q0_wi_old*q3_vw_old - q1_wi_old*q2_vw_old + q2_wi_old*q1_vw_old + q3_wi_old*q0_vw_old) + q3_ic_old*(q0_wi_old*q2_vw_old + q2_wi_old*q0_vw_old + q1_wi_old*q3_vw_old - q3_wi_old*q1_vw_old))*(q0_ic_new*q3_wi_new - q1_ic_new*q2_wi_new + q2_ic_new*q1_wi_new + q3_ic_new*q0_wi_new) + (q0_ic_old*(q0_wi_old*q2_vw_old + q2_wi_old*q0_vw_old + q1_wi_old*q3_vw_old - q3_wi_old*q1_vw_old) + q1_ic_old*(q0_wi_old*q3_vw_old - q1_wi_old*q2_vw_old + q2_wi_old*q1_vw_old + q3_wi_old*q0_vw_old) - q2_ic_old*(q1_wi_old*q1_vw_old - q0_wi_old*q0_vw_old + q2_wi_old*q2_vw_old + q3_wi_old*q3_vw_old) - q3_ic_old*(q0_wi_old*q1_vw_old + q1_wi_old*q0_vw_old - q2_wi_old*q3_vw_old + q3_wi_old*q2_vw_old))*(q1_ic_new*q1_wi_new - q0_ic_new*q0_wi_new + q2_ic_new*q2_wi_new + q3_ic_new*q3_wi_new) - (q0_ic_old*(q0_wi_old*q3_vw_old - q1_wi_old*q2_vw_old + q2_wi_old*q1_vw_old + q3_wi_old*q0_vw_old) - q1_ic_old*(q0_wi_old*q2_vw_old + q2_wi_old*q0_vw_old + q1_wi_old*q3_vw_old - q3_wi_old*q1_vw_old) + q2_ic_old*(q0_wi_old*q1_vw_old + q1_wi_old*q0_vw_old - q2_wi_old*q3_vw_old + q3_wi_old*q2_vw_old) - q3_ic_old*(q1_wi_old*q1_vw_old - q0_wi_old*q0_vw_old + q2_wi_old*q2_vw_old + q3_wi_old*q3_vw_old))*(q0_ic_new*q1_wi_new + q1_ic_new*q0_wi_new - q2_ic_new*q3_wi_new + q3_ic_new*q2_wi_new), - (q0_ic_old*(q1_wi_old*q1_vw_old - q0_wi_old*q0_vw_old + q2_wi_old*q2_vw_old + q3_wi_old*q3_vw_old) + q1_ic_old*(q0_wi_old*q1_vw_old + q1_wi_old*q0_vw_old - q2_wi_old*q3_vw_old + q3_wi_old*q2_vw_old) + q2_ic_old*(q0_wi_old*q2_vw_old + q2_wi_old*q0_vw_old + q1_wi_old*q3_vw_old - q3_wi_old*q1_vw_old) + q3_ic_old*(q0_wi_old*q3_vw_old - q1_wi_old*q2_vw_old + q2_wi_old*q1_vw_old + q3_wi_old*q0_vw_old))*(q0_ic_new*q1_wi_new + q1_ic_new*q0_wi_new - q2_ic_new*q3_wi_new + q3_ic_new*q2_wi_new) - (q0_ic_old*(q0_wi_old*q1_vw_old + q1_wi_old*q0_vw_old - q2_wi_old*q3_vw_old + q3_wi_old*q2_vw_old) - q1_ic_old*(q1_wi_old*q1_vw_old - q0_wi_old*q0_vw_old + q2_wi_old*q2_vw_old + q3_wi_old*q3_vw_old) - q2_ic_old*(q0_wi_old*q3_vw_old - q1_wi_old*q2_vw_old + q2_wi_old*q1_vw_old + q3_wi_old*q0_vw_old) + q3_ic_old*(q0_wi_old*q2_vw_old + q2_wi_old*q0_vw_old + q1_wi_old*q3_vw_old - q3_wi_old*q1_vw_old))*(q1_ic_new*q1_wi_new - q0_ic_new*q0_wi_new + q2_ic_new*q2_wi_new + q3_ic_new*q3_wi_new) - (q0_ic_old*(q0_wi_old*q2_vw_old + q2_wi_old*q0_vw_old + q1_wi_old*q3_vw_old - q3_wi_old*q1_vw_old) + q1_ic_old*(q0_wi_old*q3_vw_old - q1_wi_old*q2_vw_old + q2_wi_old*q1_vw_old + q3_wi_old*q0_vw_old) - q2_ic_old*(q1_wi_old*q1_vw_old - q0_wi_old*q0_vw_old + q2_wi_old*q2_vw_old + q3_wi_old*q3_vw_old) - q3_ic_old*(q0_wi_old*q1_vw_old + q1_wi_old*q0_vw_old - q2_wi_old*q3_vw_old + q3_wi_old*q2_vw_old))*(q0_ic_new*q3_wi_new - q1_ic_new*q2_wi_new + q2_ic_new*q1_wi_new + q3_ic_new*q0_wi_new) - (q0_ic_old*(q0_wi_old*q3_vw_old - q1_wi_old*q2_vw_old + q2_wi_old*q1_vw_old + q3_wi_old*q0_vw_old) - q1_ic_old*(q0_wi_old*q2_vw_old + q2_wi_old*q0_vw_old + q1_wi_old*q3_vw_old - q3_wi_old*q1_vw_old) + q2_ic_old*(q0_wi_old*q1_vw_old + q1_wi_old*q0_vw_old - q2_wi_old*q3_vw_old + q3_wi_old*q2_vw_old) - q3_ic_old*(q1_wi_old*q1_vw_old - q0_wi_old*q0_vw_old + q2_wi_old*q2_vw_old + q3_wi_old*q3_vw_old))*(q0_ic_new*q2_wi_new + q2_ic_new*q0_wi_new + q1_ic_new*q3_wi_new - q3_ic_new*q1_wi_new),   (q0_ic_old*(q0_wi_old*q1_vw_old + q1_wi_old*q0_vw_old - q2_wi_old*q3_vw_old + q3_wi_old*q2_vw_old) - q1_ic_old*(q1_wi_old*q1_vw_old - q0_wi_old*q0_vw_old + q2_wi_old*q2_vw_old + q3_wi_old*q3_vw_old) - q2_ic_old*(q0_wi_old*q3_vw_old - q1_wi_old*q2_vw_old + q2_wi_old*q1_vw_old + q3_wi_old*q0_vw_old) + q3_ic_old*(q0_wi_old*q2_vw_old + q2_wi_old*q0_vw_old + q1_wi_old*q3_vw_old - q3_wi_old*q1_vw_old))*(q0_ic_new*q1_wi_new + q1_ic_new*q0_wi_new - q2_ic_new*q3_wi_new + q3_ic_new*q2_wi_new) - (q0_ic_old*(q1_wi_old*q1_vw_old - q0_wi_old*q0_vw_old + q2_wi_old*q2_vw_old + q3_wi_old*q3_vw_old) + q1_ic_old*(q0_wi_old*q1_vw_old + q1_wi_old*q0_vw_old - q2_wi_old*q3_vw_old + q3_wi_old*q2_vw_old) + q2_ic_old*(q0_wi_old*q2_vw_old + q2_wi_old*q0_vw_old + q1_wi_old*q3_vw_old - q3_wi_old*q1_vw_old) + q3_ic_old*(q0_wi_old*q3_vw_old - q1_wi_old*q2_vw_old + q2_wi_old*q1_vw_old + q3_wi_old*q0_vw_old))*(q1_ic_new*q1_wi_new - q0_ic_new*q0_wi_new + q2_ic_new*q2_wi_new + q3_ic_new*q3_wi_new) + (q0_ic_old*(q0_wi_old*q2_vw_old + q2_wi_old*q0_vw_old + q1_wi_old*q3_vw_old - q3_wi_old*q1_vw_old) + q1_ic_old*(q0_wi_old*q3_vw_old - q1_wi_old*q2_vw_old + q2_wi_old*q1_vw_old + q3_wi_old*q0_vw_old) - q2_ic_old*(q1_wi_old*q1_vw_old - q0_wi_old*q0_vw_old + q2_wi_old*q2_vw_old + q3_wi_old*q3_vw_old) - q3_ic_old*(q0_wi_old*q1_vw_old + q1_wi_old*q0_vw_old - q2_wi_old*q3_vw_old + q3_wi_old*q2_vw_old))*(q0_ic_new*q2_wi_new + q2_ic_new*q0_wi_new + q1_ic_new*q3_wi_new - q3_ic_new*q1_wi_new) - (q0_ic_old*(q0_wi_old*q3_vw_old - q1_wi_old*q2_vw_old + q2_wi_old*q1_vw_old + q3_wi_old*q0_vw_old) - q1_ic_old*(q0_wi_old*q2_vw_old + q2_wi_old*q0_vw_old + q1_wi_old*q3_vw_old - q3_wi_old*q1_vw_old) + q2_ic_old*(q0_wi_old*q1_vw_old + q1_wi_old*q0_vw_old - q2_wi_old*q3_vw_old + q3_wi_old*q2_vw_old) - q3_ic_old*(q1_wi_old*q1_vw_old - q0_wi_old*q0_vw_old + q2_wi_old*q2_vw_old + q3_wi_old*q3_vw_old))*(q0_ic_new*q3_wi_new - q1_ic_new*q2_wi_new + q2_ic_new*q1_wi_new + q3_ic_new*q0_wi_new)]];

elseif (param.fusion.camFixQuatvw == 1)
    H_z_q_relative_qvw_new = zeros(4,4);
                
end

% qH_relative
H_Att_Relative = [H_z_q_relative_qwi_old, zeros(4,24), H_z_q_relative_qic_old, zeros(4,3), H_z_q_relative_qvw_old, H_z_q_relative_qwi_new, zeros(4,24), H_z_q_relative_qic_new, zeros(4,3), H_z_q_relative_qvw_new];